Jet\Form_Renderer_Single

A general abstract class of renderers of unpaired form elements that inherits from the Jet\Form_Renderer class.

Overview of methods

Method Meaning of
public getViewScript(
) : string
Returns the name of the view script for displaying the given element.
public setViewScript(
string $view_script
) : static
Allows to set an optional name view of the script for displaying the element.

Each element sets a default value in the constructor according to system settings. So you don't need to use the method, but you can use it if you want a specific display of the element for a specific form.
public render(
) : string
Generates the HTML code for the element based on the current settings.
public setCustomRenderer(
?Closure $custom_renderer
) : void
Sets the optional renderer for the element. Thanks to the renderByView method, this renderer has the possibility to use the original renderer using the view. Example of use: $field->input()->setCustomRenderer(function() {
    
?>
    Something around ...
    <div style="display:none;">
        <?=$this->renderByView()?>
    </div>
    Something around ...
    <?php
});

echo 
$field;
public getCustomRenderer(
) : ?Closure
Returns the currently set optional renderer. See the setCustomRenderer method.
public renderByView(
) : string
Renders the element using view even if the optional renderer is set. See the setCustomRenderer method.
public __toString(
) : string
The element can be directly converted to string, which calls the render method.
public toString(
) : string
Alias of the render method.
Previous chapter
Jet\Form_Renderer
Next chapter
Jet\Form_Renderer_Pair