InputWidgetHtmlBase Class Reference

A text area for HTML input. More...

Inheritance diagram for InputWidgetHtmlBase:
InputWidgetTextareaBase InputWidgetBase InputWidgetBaseBase InputWidgetBaseBase IWidget IWidget IRenderer IRenderer InputWidgetHtml

List of all members.

Protected Member Functions

  render_input ($attrs, $params, $name, $title, $value, $policy)
  Render the actual widget.

Detailed Description

A text area for HTML input.

To invoke it, use HtmlText::WIDGET as type for WidgetInput.


 print WidgetInput::output('content', 'Edit post content:', $form_data, HtmlText::WIDGET, array('model' => 'posts', 'editor' => 'basic'));

This will create a textarea with classes "rte" and "rte_{EDITOR}" set. Given above example, this would be "rte rte_basic".

The default value gets converted using the HtmlText::EDIT conversions. You may pass a model as parameter 'model', if you don't, default conversions will be used.

Additionally, rich text editors are enabled, if any are available. You may pass an editor config'name as parameter 'editor'. If none is given, default configuration will be used.

Gerd Riesselmann

Definition at line 24 of file html.input.widget.php.

Member Function Documentation

InputWidgetHtmlBase::render_input ( attrs,
) [protected]

Render the actual widget.

Reimplemented from InputWidgetTextareaBase.

Definition at line 28 of file html.input.widget.php.

00028                                                                                          {
00029                 $model = Arr::get_item($params, 'model', HtmlText::CONVERSION_DEFAULT);
00030                 $value = HtmlText::apply_conversion(HtmlText::EDIT, $value, $model);
00032                 $editor = Arr::get_item($params, 'editor', HtmlText::EDITOR_DEFAULT);
00033                 HtmlText::enable_editor($editor);
00035                 $attrs['class'] = trim(Arr::get_item($attrs, 'class', '') . ' rte rte_' . strtolower($editor));
00036                 return parent::render_input($attrs, $params, $name, $title, $value, $policy);
00037         }

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