Stud.IP  6.0
OptionsWidget Class Reference
Inheritance diagram for OptionsWidget:
ListWidget SidebarWidget Widget

Public Member Functions

 __construct (?string $title=null)
 
 addCheckbox (string $label, $state, string $toggle_url, ?string $toggle_url_off=null, array $attributes=[])
 
 addRadioButton (string $label, string $url, $checked=false, array $attributes=[])
 
 addSelect (string $label, $url, string $name, array $options, $selected_option=false, array $attributes=[])
 
- Public Member Functions inherited from ListWidget
 __construct ()
 
 addCSSClass ($css_class)
 
 removeCSSClass ($css_class)
 
 addSeparator ($attributes=[])
 
 render ($variables=[])
 
- Public Member Functions inherited from SidebarWidget
 __construct ()
 
 setId (string $id)
 
 getId ()
 
 setTitle ($title)
 
 getTitle ()
 
 removeTitle ()
 
 setExtra ($extra)
 
 getExtra ()
 
 removeExtra ()
 
 setAdditionalAttribute (string $key, $value)
 
 setAdditionalAttributes (array $attributes)
 
 removeAdditionalAttribute (string $key)
 
 render ($variables=[])
 
- Public Member Functions inherited from Widget
 addElement (WidgetElement $element, $index=null)
 
 insertElement (WidgetElement $element, $before_index, $index=null)
 
 getElement ($index)
 
 getElements ()
 
 removeElement ($index)
 
 hasElements ()
 
 hasElement ($index)
 
 forceRendering ($state=true)
 
 addLayoutCSSClass ($css_class)
 
 removeLayoutCSSClass ($css_class)
 
 render ($variables=[])
 
 __isset ($offset)
 
 __get ($offset)
 
 __set ($offset, $value)
 
 __unset ($offset)
 

Data Fields

const INDEX = 'options'
 

Additional Inherited Members

- Protected Member Functions inherited from Widget
 guessIndex (WidgetElement $element)
 
- Protected Attributes inherited from ListWidget
 $css_classes = []
 
- Protected Attributes inherited from SidebarWidget
 $additional_attributes = []
 
- Protected Attributes inherited from Widget
 $elements = []
 
 $template = 'widgets/widget'
 
 $template_variables = []
 
 $layout = 'widgets/widget-layout'
 
 $forced_rendering = false
 
 $layout_css_classes = []
 

Detailed Description

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version

Constructor & Destructor Documentation

◆ __construct()

__construct ( ?string  $title = null)
Parameters
string | null$titleOptional alternative title

Member Function Documentation

◆ addCheckbox()

addCheckbox ( string  $label,
  $state,
string  $toggle_url,
?string  $toggle_url_off = null,
array  $attributes = [] 
)
Parameters
string$label
bool$state
string$toggle_urlUrl to execute the action
string | null$toggle_url_offOptional alternative url to explicitely turn off the checkbox ($toggle_url will then act as $toggle_url_on)
Array$attributesOptional additional attributes for the anchor
Returns
ButtonElement

◆ addRadioButton()

addRadioButton ( string  $label,
string  $url,
  $checked = false,
array  $attributes = [] 
)

Adds a radio button to the widget.

Parameters
string$label
string$url
bool$checked
array$attributes
Returns
ButtonElement

◆ addSelect()

addSelect ( string  $label,
  $url,
string  $name,
array  $options,
  $selected_option = false,
array  $attributes = [] 
)

Adds a select element to the widget.

Parameters
string$label
string$url
string$nameAttribute name
array$optionsArray of associative options (value => label)
mixed$selected_optionCurrently selected option
array$attributesAdditional attributes

Field Documentation

◆ INDEX

const INDEX = 'options'

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