PHP Class FOF30\View\DataView\Json

Inheritance: extends Raw, implements FOF30\View\DataView\DataViewInterface
Afficher le fichier Open project: akeeba/fof

Méthodes publiques

Свойство 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

Свойство Type Description
$item
$limit
$limitStart
$total

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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 méthode

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
Résultat FOF30\Hal\Document A HAL-enabled document

_getPrototypeURIForPagination() protected méthode

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

_removeURIBase() protected méthode

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

display() public méthode

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

onAfterSave() protected méthode

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 méthode

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 méthode

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 méthode

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
Résultat 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
Résultat boolean