PHP Class FOF30\View\DataView\Json

Inheritance: extends Raw, implements FOF30\View\DataView\DataViewInterface
Datei anzeigen Open project: akeeba/fof

Public Properties

Property Type Description
$alreadyLoaded boolean Set to true if your onBefore* methods have already populated the item, items, limitstart etc properties used to render a JSON document.
$useHypermedia boolean When set to true we'll add hypermedia to the output, implementing the HAL specification (http://stateless.co/hal_specification.html)

Protected Properties

Property Type Description
$item
$limit
$limitStart
$total

Public Methods

Method Description
display ( string $tpl = null ) : boolean Overrides the default method to execute and display a template script.
onBeforeBrowse ( string $tpl = null ) The event which runs when we are displaying the record list JSON view

Protected Methods

Method Description
_createDocumentWithHypermedia ( mixed | array $data, DataModel $model = null ) : Document Creates a \FOF30\Hal\Document using the provided data
_getPrototypeURIForPagination ( ) : JUri Returns a JUri instance with a prototype URI used as the base for the other URIs created by the JSON renderer
_removeURIBase ( string $uri ) : string Convert an absolute URI to a relative one
onAfterSave ( string $tpl = null ) The event which runs when we are displaying a single item JSON view
onBeforeRead ( string $tpl = null ) The event which runs when we are displaying a single item JSON view
renderSingleItem ( string $tpl ) Renders a single item JSON view

Method Details

_createDocumentWithHypermedia() protected method

Creates a \FOF30\Hal\Document using the provided data
protected _createDocumentWithHypermedia ( mixed | array $data, DataModel $model = null ) : Document
$data mixed | array The data to put in the document
$model FOF30\Model\DataModel The model of this view
return FOF30\Hal\Document A HAL-enabled document

_getPrototypeURIForPagination() protected method

Returns a JUri instance with a prototype URI used as the base for the other URIs created by the JSON renderer
protected _getPrototypeURIForPagination ( ) : JUri
return JUri The prototype JUri instance

_removeURIBase() protected method

Convert an absolute URI to a relative one
protected _removeURIBase ( string $uri ) : string
$uri string The URI to convert
return string The relative URL

display() public method

Instead of loadTemplate is uses loadAnyTemplate.
public display ( string $tpl = null ) : boolean
$tpl string The name of the template file to parse
return boolean True on success

onAfterSave() protected method

The event which runs when we are displaying a single item JSON view
protected onAfterSave ( string $tpl = null )
$tpl string The view sub-template to use

onBeforeBrowse() public method

The event which runs when we are displaying the record list JSON view
public onBeforeBrowse ( string $tpl = null )
$tpl string The sub-template to use

onBeforeRead() protected method

The event which runs when we are displaying a single item JSON view
protected onBeforeRead ( string $tpl = null )
$tpl string The view sub-template to use

renderSingleItem() protected method

Renders a single item JSON view
protected renderSingleItem ( string $tpl )
$tpl string The view sub-template to use

Property Details

$alreadyLoaded public_oe property

Set to true if your onBefore* methods have already populated the item, items, limitstart etc properties used to render a JSON document.
public bool $alreadyLoaded
return boolean

$item protected_oe property

protected $item

$limit protected_oe property

protected $limit

$limitStart protected_oe property

protected $limitStart

$total protected_oe property

protected $total

$useHypermedia public_oe property

When set to true we'll add hypermedia to the output, implementing the HAL specification (http://stateless.co/hal_specification.html)
public bool $useHypermedia
return boolean