RendererProviderJSON
in package
implements
RendererProviderInterface
JSON renderer.
Tags
Table of Contents
Interfaces
- RendererProviderInterface
- 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.
Properties
- $logger : Logger
- Trace logger.
- $record : ActiveRecord
- The active record that we are renderering.
Methods
- __construct() : mixed
- The constructor.
- 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.
Properties
$logger
Trace logger.
private
static Logger
$logger
= null
Tags
$record
The active record that we are renderering.
private
ActiveRecord
$record
Tags
Methods
__construct()
The constructor.
public
__construct() : mixed
Tags
adminView()
Renders the admin view for the Record using the selected renderer.
public
adminView([mixed $fields = array() ]) : string
Parameters
- $fields : mixed = array()
-
Hash array of fields to pass to the template.
Return values
stringcreateView()
Renders the create view for the Record using the selected renderer.
public
createView([mixed $fields = array() ]) : string
Parameters
- $fields : mixed = array()
-
Hash array of fields to pass to the template.
Return values
stringdetailedView()
Renders the detailed read-only view for the Record using the selected renderer.
public
detailedView([mixed $fields = array() ]) : string
Parameters
- $fields : mixed = array()
-
Hash array of fields to pass to the template.
Return values
stringdisplayErrorMessage()
Renders an error (e.g. save failed) message.
public
static displayErrorMessage(mixed $message) : string
Parameters
- $message : mixed
Return values
stringdisplayPageFoot()
Renders the footer content using the given renderer.
public
static displayPageFoot(mixed $controller) : string
Parameters
- $controller : mixed
Return values
stringdisplayPageHead()
Renders the header content using the given renderer.
public
static displayPageHead(mixed $controller) : string
Parameters
- $controller : mixed
Return values
stringdisplayUpdateMessage()
Renders an update (e.g. successful save) message.
public
static displayUpdateMessage(mixed $message) : string
Parameters
- $message : mixed
Return values
stringeditView()
Renders the edit view for the Record using the selected renderer.
public
editView([mixed $fields = array() ]) : string
Parameters
- $fields : mixed = array()
-
Hash array of fields to pass to the template.
Return values
stringlistView()
Renders the list view for the Record using the selected renderer.
public
listView([mixed $fields = array() ]) : string
Parameters
- $fields : mixed = array()
-
Hash array of fields to pass to the template.
Return values
stringrenderAllFields()
Convenience method that renders all fields for the current Record in edit/create/view mode.
public
renderAllFields(mixed $mode[, mixed $filterFields = array() ][, mixed $readOnlyFields = array() ]) : string
Parameters
- $mode : mixed
-
(view|edit|create)
- $filterFields : mixed = array()
-
Optional list of field names to exclude from rendering.
- $readOnlyFields : mixed = array()
-
Optional list of fields to render in a readonly fashion when rendering in create or edit mode.
Return values
stringrenderBooleanField()
Renders an Boolean field value.
public
renderBooleanField(mixed $name, mixed $label, mixed $mode[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $value : mixed = ''
-
The field value (optional)
Return values
stringrenderDefaultField()
Method to render a field when type is not known.
public
renderDefaultField(mixed $name, mixed $label, mixed $mode[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $value : mixed = ''
-
The field value (optional)
Return values
stringrenderDeleteForm()
Method to render a hidden HTML form for posting the ID of an object to be deleted.
public
static renderDeleteForm(mixed $URI) : string
Parameters
- $URI : mixed
-
The URI that the form will point to
Return values
stringrenderDEnumField()
Renders an DEnum field value.
public
renderDEnumField(mixed $name, mixed $label, mixed $mode, mixed $options[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $options : mixed
-
The DEnum options
- $value : mixed = ''
-
The field value (optional)
Return values
stringrenderDoubleField()
Renders an Double field value.
public
renderDoubleField(mixed $name, mixed $label, mixed $mode[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $value : mixed = ''
-
The field value (optional)
Return values
stringrenderEnumField()
Renders an Enum field value.
public
renderEnumField(mixed $name, mixed $label, mixed $mode, mixed $options[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $options : mixed
-
The Enum options
- $value : mixed = ''
-
The field value (optional)
Return values
stringrenderErrorPage()
Renders an error page with the supplied HTTP error code and a message.
public
static renderErrorPage(mixed $code, mixed $message) : string
Parameters
- $code : mixed
- $message : mixed
Return values
stringrenderIntegerField()
Renders an Integer field value.
public
renderIntegerField(mixed $name, mixed $label, mixed $mode[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $value : mixed = ''
-
The field value (optional)
Return values
stringrenderRelationField()
Renders a Relation field value.
public
renderRelationField(mixed $name, mixed $label, mixed $mode[, mixed $value = '' ][, mixed $expanded = false ][, mixed $buttons = true ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $value : mixed = ''
-
The field value (optional)
- $expanded : mixed = false
-
Render the related fields in expanded format or not (optional)
- $buttons : mixed = true
-
Render buttons for expanding/contacting the related fields (optional)
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
Return values
stringrenderStringField()
Renders a String field value.
public
renderStringField(mixed $name, mixed $label, mixed $mode[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $value : mixed = ''
-
The field value (optional)
Return values
stringrenderTextField()
Renders a Text field value.
public
renderTextField(mixed $name, mixed $label, mixed $mode[, mixed $value = '' ]) : string
Parameters
- $name : mixed
-
The field name
- $label : mixed
-
The label to apply to the field
- $mode : mixed
-
The field mode (create/edit/view)
- $value : mixed = ''
-
The field value (optional)
Return values
stringsetRecord()
Provide the Record that we are going render.
public
setRecord(mixed $record) : void
Parameters
- $record : mixed