RendererProviderInterface
in
Defines the renderer interface, which allows us to have various implementations (HTML, JSON, XML etc.) behind one unified interface. Use the ServiceFactory::getInstance() method to get instances of this.
Tags
Table of Contents
Methods
- adminView() : string
- Renders the admin view for the Record using the selected renderer.
- createView() : string
- Renders the create view for the Record using the selected renderer.
- detailedView() : string
- Renders the detailed read-only view for the Record using the selected renderer.
- displayErrorMessage() : string
- Renders an error (e.g. save failed) message.
- displayPageFoot() : string
- Renders the footer content using the given renderer.
- displayPageHead() : string
- Renders the header content using the given renderer.
- displayUpdateMessage() : string
- Renders an update (e.g. successful save) message.
- editView() : string
- Renders the edit view for the Record using the selected renderer.
- listView() : string
- Renders the list view for the Record using the selected renderer.
- renderAllFields() : string
- Convenience method that renders all fields for the current Record in edit/create/view mode.
- renderBooleanField() : string
- Renders an Boolean field value.
- renderDefaultField() : string
- Method to render a field when type is not known.
- renderDeleteForm() : string
- Method to render a hidden HTML form for posting the ID of an object to be deleted.
- renderDEnumField() : string
- Renders an DEnum field value.
- renderDoubleField() : string
- Renders an Double field value.
- renderEnumField() : string
- Renders an Enum field value.
- renderErrorPage() : string
- Renders an error page with the supplied HTTP error code and a message.
- renderIntegerField() : string
- Renders an Integer field value.
- renderRelationField() : string
- Renders a Relation field value.
- renderSecurityFields() : string
- Method to render a HTML form with two hidden, hashed (MD5) form fields to be used as a check to ensure that a post to the controller is being sent from the same server as hosting it.
- renderStringField() : string
- Renders a String field value.
- renderTextField() : string
- Renders a Text field value.
- setRecord() : void
- Provide the Record that we are going render.
Methods
adminView()
Renders the admin view for the Record using the selected renderer.
public
adminView([array<string|int, mixed> $fields = array() ]) : string
Parameters
- $fields : array<string|int, mixed> = array()
-
Hash array of fields to pass to the template.
Tags
Return values
stringcreateView()
Renders the create view for the Record using the selected renderer.
public
createView([array<string|int, mixed> $fields = array() ]) : string
Parameters
- $fields : array<string|int, mixed> = array()
-
Hash array of fields to pass to the template.
Tags
Return values
stringdetailedView()
Renders the detailed read-only view for the Record using the selected renderer.
public
detailedView([array<string|int, mixed> $fields = array() ]) : string
Parameters
- $fields : array<string|int, mixed> = array()
-
Hash array of fields to pass to the template.
Tags
Return values
stringdisplayErrorMessage()
Renders an error (e.g. save failed) message.
public
static displayErrorMessage(string $message) : string
Parameters
- $message : string
Tags
Return values
stringdisplayPageFoot()
Renders the footer content using the given renderer.
public
static displayPageFoot(Controller $controller) : string
Parameters
- $controller : Controller
Tags
Return values
stringdisplayPageHead()
Renders the header content using the given renderer.
public
static displayPageHead(Controller $controller) : string
Parameters
- $controller : Controller
Tags
Return values
stringdisplayUpdateMessage()
Renders an update (e.g. successful save) message.
public
static displayUpdateMessage(string $message) : string
Parameters
- $message : string
Tags
Return values
stringeditView()
Renders the edit view for the Record using the selected renderer.
public
editView([array<string|int, mixed> $fields = array() ]) : string
Parameters
- $fields : array<string|int, mixed> = array()
-
Hash array of fields to pass to the template.
Tags
Return values
stringlistView()
Renders the list view for the Record using the selected renderer.
public
listView([array<string|int, mixed> $fields = array() ]) : string
Parameters
- $fields : array<string|int, mixed> = array()
-
Hash array of fields to pass to the template.
Tags
Return values
stringrenderAllFields()
Convenience method that renders all fields for the current Record in edit/create/view mode.
public
renderAllFields(string $mode[, array<string|int, mixed> $filterFields = array() ][, array<string|int, mixed> $readOnlyFields = array() ]) : string
Parameters
- $mode : string
-
(view|edit|create)
- $filterFields : array<string|int, mixed> = array()
-
Optional list of field names to exclude from rendering.
- $readOnlyFields : array<string|int, mixed> = array()
-
Optional list of fields to render in a readonly fashion when rendering in create or edit mode.
Tags
Return values
stringrenderBooleanField()
Renders an Boolean field value.
public
renderBooleanField(string $name, string $label, string $mode[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringrenderDefaultField()
Method to render a field when type is not known.
public
renderDefaultField(string $name, string $label, string $mode[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringrenderDeleteForm()
Method to render a hidden HTML form for posting the ID of an object to be deleted.
public
static renderDeleteForm(string $URI) : string
Parameters
- $URI : string
-
The URI that the form will point to
Tags
Return values
stringrenderDEnumField()
Renders an DEnum field value.
public
renderDEnumField(string $name, string $label, string $mode, array<string|int, mixed> $options[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $options : array<string|int, mixed>
-
The DEnum options
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringrenderDoubleField()
Renders an Double field value.
public
renderDoubleField(string $name, string $label, string $mode[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringrenderEnumField()
Renders an Enum field value.
public
renderEnumField(string $name, string $label, string $mode, array<string|int, mixed> $options[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $options : array<string|int, mixed>
-
The Enum options
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringrenderErrorPage()
Renders an error page with the supplied HTTP error code and a message.
public
static renderErrorPage(string $code, string $message) : string
Parameters
- $code : string
- $message : string
Tags
Return values
stringrenderIntegerField()
Renders an Integer field value.
public
renderIntegerField(string $name, string $label, string $mode[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringrenderRelationField()
Renders a Relation field value.
public
renderRelationField(string $name, string $label, string $mode[, string $value = '' ][, bool $expanded = false ][, bool $buttons = true ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $value : string = ''
-
The field value (optional)
- $expanded : bool = false
-
Render the related fields in expanded format or not (optional)
- $buttons : bool = true
-
Render buttons for expanding/contacting the related fields (optional)
Tags
Return values
stringrenderSecurityFields()
Method to render a HTML form with two hidden, hashed (MD5) form fields to be used as a check to ensure that a post to the controller is being sent from the same server as hosting it.
public
static renderSecurityFields() : string
Tags
Return values
stringrenderStringField()
Renders a String field value.
public
renderStringField(string $name, string $label, string $mode[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringrenderTextField()
Renders a Text field value.
public
renderTextField(string $name, string $label, string $mode[, string $value = '' ]) : string
Parameters
- $name : string
-
The field name
- $label : string
-
The label to apply to the field
- $mode : string
-
The field mode (create/edit/view)
- $value : string = ''
-
The field value (optional)
Tags
Return values
stringsetRecord()
Provide the Record that we are going render.
public
setRecord(ActiveRecord $Record) : void
Parameters
- $Record : ActiveRecord