Jet\UI_Renderer

A general abstract class of UI element renderers - the base class from which other element classes inherit.

Overview of methods

Method Meaning of
public setId(
string $id
) : static
Optionally allows to set the ID of the element. The default state is that the element has no ID.
public getId(
) : string
Returns value of element ID.
public getViewDir(
) : string
Returns the path to the view root directory of UI element scripts.

The default path is determined by the system configuration SysConf_Jet_UI and it is necessary to set it before using the UI generation (for example, in the base initializer).

However, in case of a special situation, it is possible to set an extra value for an individual element.
public setViewDir(
string $views_dir
) : void
Sets the path to the root view directory of UI element scripts.

See the getViewDir method.
public getView(
) : MVC_View
Returns a prepared and loaded view instance of the given renderer.

Each individual renderer keeps its own view instance. Therefore, if needed, additional parameters and values can be passed to view scripts using this instance.
public addJsAction(
string $event,
string $handler_code
) : static
Allows you to add event handlers and JavaScript calls to the element.
public getJsActions(
) : array
Returns the set event handlers. See the addJsAction method.
public setBaseCssClass(
string $base_css_class
) : static
Sets the base CSS class (or classes - usually separated by a space character) of the element.

Since this is a frontend appearance issue, this call should be made in the view script of the element.
public getBaseCssClasses(
) : array
Returns the base CSS of the element class. See the setBaseCssClass method.
public addCustomCssClass(
string $class
) : static
Adds one optional CSS element class. The method can be called repeatedly - so add any number of optional classes.
public getCustomCssClasses(
) : array
Returns a list of optional CSS classes. See the addCustomCssClass method.
public getCssClasses(
) : array
Returns a list of all CSS classes that belong to the element according to all settings. The list is returned as an array.
public addCustomCssStyle(
string $style
) : static
Allows you to add an optional CSS style to the element if needed. It is possible to call the method repeatedly.
public getCssStyles(
) : array
Returns a list of optional CSS styles. See the addCustomCssStyle method.
public setDataAttribute(
string $attr,
string $value
) : static
Allows the element to set data-attributes. Thus: data-something="SomeValue".
public unsetDataAttribute(
string $attr
) : static
Cancels the data-attribute setting. See the setDataAttribute method.
public getDataAttributes(
) : array
Returns a list of all set data-attribute. See the setDataAttribute method.
public setCustomTagAttribute(
string $attr,
string $value
) : static
It allows to set any attribute of the tag of the element.

The method can be used in the view in which the form is displayed.
public unsetCustomTagAttribute(
string $attr
) : static
Disables the optional setting of the element tag attribute. See the setCustomTagAttribute method.
public getCustomTagAttributes(
) : array
Returns the current optional attribute settings for the element tag. See the setCustomTagAttribute method.
public generateTagAttributes(
) : array
According to the current settings, it generates all the attributes of the element tag and returns them as an associated array.
public renderTagAttributes(
) : string
According to the current settings, it generates all the attributes of the element tag and directly generates a string that can be displayed.
Previous chapter
Jet\UI
Next chapter
Jet\UI_Renderer_Single