Framework  3.9
StaticFieldRenderer Class Reference
+ Inheritance diagram for StaticFieldRenderer:
+ Collaboration diagram for StaticFieldRenderer:

Public Member Functions

 __construct ($form, $field, $label)
 
 renderField ($field)
 FieldRenderers must override this method to provide the HTML implementation of the control used to edit the field. More...
 
 renderReadOnly ($field)
 
- Public Member Functions inherited from FieldRenderer
 FieldRenderer ($parent)
 Constructor. More...
 
 _printLabel ($field, $colspan=1, $styles="", $annotation="")
 Internal method to generate the HTML for the field label. More...
 
 _getLabel ($field, $addSuffix=true)
 
 _startField ($field, $styles="")
 Internal method to generate the starting HTML for the field (including the label) More...
 
 _endField ($field)
 Internal method to generate the closing HTML for the field. More...
 
 addValidatorsToForm ($field, $required=false)
 This method is called by the AutoForm to add any default input validators that are required by the FieldRenderer. More...
 
 addSearchValidatorsToForm ($field, $mode, $required=false)
 For SearchForm, the validator field needs to match the name tag in the form which is in the format field:mode. More...
 
 formatName ($item, $name)
 Formats the given DataItem based on the supplied format string. More...
 
 renderScript ($field)
 FieldRenderers can override this method to provide any Javascript that their control requires for an edit form. More...
 
 renderSearchScript ($field, $mode)
 FieldRenderers can override this method to provide any Javascript that the control requires when being used in a search form. More...
 
 renderSearchField ($field, $mode)
 FieldRenderers must override this method to provide the HTML implementation of the control displayed for the field in a search form. More...
 
 renderOnSubmitHandler ($field)
 FieldRenderers can override this method to provide any Javascript that must be executed when the form is submitted on the client. More...
 
 preProcess ($field="")
 FieldRenderers can override this method to provide behavior that occurs prior to the saving of the parent form's target object to the database. More...
 
 postProcess ($field="")
 FieldRenderers can override this method to provide behavior that occurs after the parent form's target object has been saved to the database. More...
 

Additional Inherited Members

- Public Attributes inherited from FieldRenderer
 $parent = null
 
 $labelSuffix = ""
 
 $colspan = 1
 
 $annotateBefore = false
 
 $annotateNextLine = true
 
 $hideLabel = false
 
 $onPreProcess = null
 callback hook for processing prior to saving the form's data object - individual renderers may override with custom processing More...
 
 $onPostProcess = null
 callback hook for processing after saving the form's data object - individual renderers may override with custom processing More...
 

Detailed Description

Definition at line 6 of file static_field_renderer.inc.

Constructor & Destructor Documentation

◆ __construct()

StaticFieldRenderer::__construct (   $form,
  $field,
  $label 
)

Definition at line 8 of file static_field_renderer.inc.

9  {
10  $this->FieldRenderer($form);
11  if ($form->data->hasField($field))
12  {
13  $form->override($field, $label, $this);
14  }
15  else
16  {
17  $form->add($this, $field);
18  if ($label) $form->alias($field, $label);
19  }
20  }
FieldRenderer($parent)
Constructor.

Member Function Documentation

◆ renderField()

StaticFieldRenderer::renderField (   $field)

FieldRenderers must override this method to provide the HTML implementation of the control used to edit the field.

Parameters
string$fieldthe field name

Reimplemented from FieldRenderer.

Definition at line 22 of file static_field_renderer.inc.

23  {
24  $this->_startField($field);
25  $obj = $this->parent->data;
26  if ($obj->hasField($field))
27  {
28  echo $obj->get($field);
29  }
30  else
31  {
32  echo $obj->getDecoration($field);
33  }
34 
35  $this->_endField($field);
36  }
_startField($field, $styles="")
Internal method to generate the starting HTML for the field (including the label)
_endField($field)
Internal method to generate the closing HTML for the field.

◆ renderReadOnly()

StaticFieldRenderer::renderReadOnly (   $field)

Definition at line 38 of file static_field_renderer.inc.

39  {
40  $this->renderField($field);
41  }
renderField($field)
FieldRenderers must override this method to provide the HTML implementation of the control used to ed...

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