PHP Класс FOF30\View\DataView\Json

Наследование: extends Raw, implements FOF30\View\DataView\DataViewInterface
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$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)

Свойство Тип Описание
$item
$limit
$limitStart
$total

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
_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

Описание методов

_createDocumentWithHypermedia() защищенный Метод

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
Результат FOF30\Hal\Document A HAL-enabled document

_getPrototypeURIForPagination() защищенный Метод

Returns a JUri instance with a prototype URI used as the base for the other URIs created by the JSON renderer
protected _getPrototypeURIForPagination ( ) : JUri
Результат JUri The prototype JUri instance

_removeURIBase() защищенный Метод

Convert an absolute URI to a relative one
protected _removeURIBase ( string $uri ) : string
$uri string The URI to convert
Результат string The relative URL

display() публичный Метод

Instead of loadTemplate is uses loadAnyTemplate.
public display ( string $tpl = null ) : boolean
$tpl string The name of the template file to parse
Результат boolean True on success

onAfterSave() защищенный Метод

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() публичный Метод

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() защищенный Метод

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() защищенный Метод

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

Описание свойств

$alreadyLoaded публичное свойство

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
Результат boolean

$item защищенное свойство

protected $item

$limit защищенное свойство

protected $limit

$limitStart защищенное свойство

protected $limitStart

$total защищенное свойство

protected $total

$useHypermedia публичное свойство

When set to true we'll add hypermedia to the output, implementing the HAL specification (http://stateless.co/hal_specification.html)
public bool $useHypermedia
Результат boolean