PHP Class PMA\libraries\Template

Handle front end templating
Mostra file Open project: phpmyadmin/phpmyadmin Class Usage Examples

Protected Properties

Property Type Description
$data Data associated with the template
$helperFunctions Helper functions for the template
$name Name of the template

Public Methods

Method Description
__call ( string $funcName, array $arguments ) Magic call to locally inaccessible but associated helper functions
get ( string $name, array $data = [], array $helperFunctions = [] ) : Template Template getter
removeHelper ( string $funcName ) Removes a function
render ( array $data = [], array $helperFunctions = [] ) : string Render template
set ( array | string $data, string $value = null ) Adds more entries to the data for this template
setHelper ( string $funcName, callable $funcDef ) Adds a function for use by the template

Protected Methods

Method Description
__construct ( string $name, array $data = [], array $helperFunctions = [] ) Template constructor

Method Details

__call() public method

Magic call to locally inaccessible but associated helper functions
public __call ( string $funcName, array $arguments )
$funcName string function name
$arguments array function arguments

__construct() protected method

Template constructor
protected __construct ( string $name, array $data = [], array $helperFunctions = [] )
$name string Template name
$data array Variables to be provided to the template
$helperFunctions array Helper functions to be used by template

get() public static method

Template getter
public static get ( string $name, array $data = [], array $helperFunctions = [] ) : Template
$name string Template name
$data array Variables to be provided to the template
$helperFunctions array Helper functions to be used by template
return Template

removeHelper() public method

Removes a function
public removeHelper ( string $funcName )
$funcName string function name

render() public method

Render template
public render ( array $data = [], array $helperFunctions = [] ) : string
$data array Variables to be provided to the template
$helperFunctions array Helper functions to be used by template
return string

set() public method

Adds more entries to the data for this template
public set ( array | string $data, string $value = null )
$data array | string containing data array or data key
$value string containing data value

setHelper() public method

Adds a function for use by the template
public setHelper ( string $funcName, callable $funcDef )
$funcName string function name
$funcDef callable function definition

Property Details

$data protected_oe property

Data associated with the template
protected $data

$helperFunctions protected_oe property

Helper functions for the template
protected $helperFunctions

$name protected_oe property

Name of the template
protected $name