PHP Trait Crud\Traits\ViewVarTrait

Mostra file Open project: friendsofcake/crud

Public Methods

Method Description
publishViewVar ( Cake\Event\Event $event ) : false | null Publish the viewVar so people can do $$viewVar and end up wit the entity in the view
viewVar ( mixed $name = null ) : mixed Change the name of the view variable name of the data when its sent to the view

Protected Methods

Method Description
_deriveViewValue ( Cake\Event\Event $event ) : mixed Derive the viewVar value based on the scope of the action as well as the Event being handled
_deriveViewVar ( ) : string Derive the viewVar based on the scope of the action

Method Details

_deriveViewValue() protected method

Derive the viewVar value based on the scope of the action as well as the Event being handled
protected _deriveViewValue ( Cake\Event\Event $event ) : mixed
$event Cake\Event\Event Event
return mixed

_deriveViewVar() protected method

Actions working on a single entity will use singular name, and actions working on a full table will use plural name
protected _deriveViewVar ( ) : string
return string

publishViewVar() public method

Publish the viewVar so people can do $$viewVar and end up wit the entity in the view
public publishViewVar ( Cake\Event\Event $event ) : false | null
$event Cake\Event\Event Event
return false | null

viewVar() public method

Change the name of the view variable name of the data when its sent to the view
public viewVar ( mixed $name = null ) : mixed
$name mixed Var name
return mixed