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

Render a widget. More...

Inheritance diagram for IWidgetRenderer:
Inheritance graph

Static Public Member Functions

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

Detailed Description

Render a widget.

Everything in a form is a widget. Widgets can render recursively nested widgets. Widgets can be form field, its label, error messages, static text, or layout.

$template_engine is external object usable for rendering which is passed by between widgets. Duf does not use it in any way but custom widgets can.

To render nested widget, call this:

$form->renderWidget($template_engine, $child_widget_conf);

Where $child_widget_conf is subtree of $widget_conf.

See also
IFormRenderer, CollectionWalker

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.

Implemented in ItemActions, SwitchWidget, CollectionActions, Tabular, AddToBasketWidget, Plain, SelectionCheckbox, Price, HtmlTemplate, GroupedList, Plain, Action, ActionLink, Heading, Slot, Text, DefaultTable, Fieldsets, NullLayout, and Table.