Stud.IP  5.4
 All Data Structures Namespaces Files Functions Variables Groups
Link Class Reference
Inheritance diagram for Link:
Part

Public Member Functions

 __construct (string $url, string $label,\Icon $icon=null)
 
 setURL (string $url)
 
 getURL ()
 
 setLabel (string $label)
 
 getLabel ()
 
 setIcon (\Icon $icon=null)
 
 getIcon ()
 
 setAttributes (array $attributes)
 
 addAttributes (array $attributes)
 
 setAttribute (string $key, $value)
 
 getAttributes ()
 
 removeAttribute (string $key, bool $throw_exception=false)
 
 render ()
 
- Public Member Functions inherited from Part
 __construct (...$parts)
 
 setContextObject ($object)
 
 getContextObject ()
 
 addPart (Part $part)
 
 addInput (Input $input)
 
 addText (string $text, bool $text_is_html=true)
 
 addLink (string $title, string $url,?\Icon $icon=null, array $attributes=[])
 
 render ()
 
 renderWithCondition ()
 
 getAllInputs ()
 
 setParent (Part $parent)
 
 setIfCondition ($if)
 
 getInputFromArray (array $data)
 

Protected Attributes

 $url
 
 $label
 
 $icon
 
 $attributes = []
 
- Protected Attributes inherited from Part
 $parent = null
 
 $contextobject = null
 
 $parts = []
 

Additional Inherited Members

- Data Fields inherited from Part
 $if = null
 

Detailed Description

The Link class represents a part of a form that displays a link.

Constructor & Destructor Documentation

__construct ( string  $url,
string  $label,
\Icon  $icon = null 
)

Member Function Documentation

addAttributes ( array  $attributes)

Adds/appends attributes to the current attributes for the link.

Parameters
array$attributes
Returns
$this
getAttributes ( )

Returns the attributes for the link.

Returns
array
getIcon ( )

Returns the icon for the link.

Returns
|null
getLabel ( )

Returns the label for the link.

Returns
string
getURL ( )

Returns the url for the link.

Returns
string
removeAttribute ( string  $key,
bool  $throw_exception = false 
)

Removes an attribute.

Parameters
string$key
bool$throw_exceptionThrow an exception if the attribute does not exists (default: false)
Returns
$this
render ( )

"Renders" the text: Either return it directly, if it is HTML or call htmlReady first before returning it.

Returns
string The text that shall be placed in the form, either as HTML or plain text.
setAttribute ( string  $key,
  $value 
)

Sets a single attribute for the link.

Parameters
string$key
mixed$value
Returns
$this
setAttributes ( array  $attributes)

Replaces all attributes for the link.

Parameters
array$attributes
Returns
$this
setIcon ( \Icon  $icon = null)

Sets the icon for the link. May be null to remove the icon.

Parameters
\Icon$icon
Returns
$this
setLabel ( string  $label)

Sets the label for the link.

Parameters
string$label
Returns
$this
setURL ( string  $url)

Sets the url for the link.

Parameters
string$url
Returns
$this

Field Documentation

$attributes = []
protected
$icon
protected
$label
protected
$url
protected

The documentation for this class was generated from the following file: