DUF: Declarative Ugly Forms  v0.1-94-g0b7957c
 All Classes Functions Variables Pages
Static Public Member Functions | List of all members
SwitchWidget Class Reference

Switch - determine which child widgets to use by given value, optionaly processed by map function. More...

Inheritance diagram for SwitchWidget:
Inheritance graph

Static Public Member Functions

static renderWidget (\Duf::Form $form, $template_engine, $widget_conf)
 Render the widget. More...
 

Detailed Description

Switch - determine which child widgets to use by given value, optionaly processed by map function.

This switch can be used for displaying values in a pretty way or to show/hide part of the form.

Field value is used to select widgets from widgets_map. These widgets are rendered as usual. Invalid values (not present in widgets_map) are silently ignored and default_widgets are used instead.

See also
Duf::Renderer::TagUtils::calculateValue()

Member Function Documentation

static renderWidget ( \Duf::Form  $form,
  $template_engine,
  $widget_conf 
)
static

Render the widget.

Parameters
$formis the Form.
$template_engineis templating engine which may be used for rendering (optional).
$widget_confis configuration of the widget. It must contain `'#!'` key to determine next renderer.

Implements IWidgetRenderer.