Parent class for *ViewHelper

ViewHelpers are handled by classes and not by instances.

package salt\view
inherited_from \salt\Identifiable

 Methods

Create a new ViewHelper

__construct(string $class) 

Have to be called by child classes for having an internal ID

inherited_from \salt\Identifiable::__construct()

Parameters

$class

string

Class name of a Base child class

Construct a new Identifiable object

__construct() 
Inherited

Have to be called by child classes for having an internal ID

Return a text for a column

column(\salt\Field $field, string $format = NULL) : string
see
inherited_from \salt\ViewHelper::column()

Parameters

$field

\salt\Field

the field to display

$format

string

format to use for change the output

Returns

stringHTML escaped text for describe $field in $format

Return a full form tag for edit the value

edit(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : string
see
inherited_from \salt\ViewHelper::edit()

Parameters

$object

\salt\Base

object that contains the value

$field

\salt\Field

the field

$value

mixed

the value to edit

$format

string

format to use

$params

array<mixed,mixed>

parameter passed to Base->FORM or Base->VIEW method

Returns

stringa full HTML form tag (input, select, etc...) for editing the value

Retrieve a ViewHelper

getInstance(string $class) : \salt\ViewHelper
Static

Parameters

$class

string

Class name of a Base child class

Returns

\salt\ViewHelperregistered ViewHelper for this class, or a BaseViewHelper instead

Get the internal unique id

getInternalId() : integer
Inherited

Returns

integerUnique ID of an instance

Get the Base object who called the ViewHelper

getObject() : \salt\Base
see
inherited_from \salt\ViewHelper::getObject()

Returns

\salt\Basethe objet to work on

Register a ViewHelper for a class

setInstance(string $class, string $helper) 
Static

Parameters

$class

string

Class name of a Base child class

$helper

string

Class name of a ViewHelper class

Return a value to display with HTML escaping

show(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : string
see
inherited_from \salt\ViewHelper::show()

Parameters

$object

\salt\Base

object that contains the value

$field

\salt\Field

the field

$value

mixed

the value to display

$format

string

format to use

$params

array<mixed,mixed>

parameter passed to Base->FORM or Base->VIEW method

Returns

stringa HTML escaped value

Return a value to display without HTML escaping

text(\salt\Base $object, \salt\Field $field, mixed $value, string $format, array<mixed,mixed> $params) : string
see
inherited_from \salt\ViewHelper::text()

Parameters

$object

\salt\Base

object that contains the value

$field

\salt\Field

the field

$value

mixed

the value to display

$format

string

format to use

$params

array<mixed,mixed>

parameter passed to Base->FORM or Base->VIEW method

Returns

stringa non-HTML escaped value

 Properties

 

current instance id

$_salt_id : integer

Default

 

last instance id

$_salt_id_sequence : integer

Default

0
Static
 

class of object this view helper work on

$class : string

Default

 

liste of instances : className => ViewHelper

$instances : array<mixed,\salt\ViewHelper>

Default

array()
Static
 

internal instance of object of class $class

$object : \salt\Base

Default