PHP Class Dietcube\Controller

Mostra file Open project: mercari/dietcube Class Usage Examples

Protected Properties

Property Type Description
$container
$view_vars

Public Methods

Method Description
__construct ( Pimple\Container $container )
setVars ( $key, $value = null )

Protected Methods

Method Description
body ( $name = null, $default = null )
findTemplate ( $name )
generateUrl ( $handler, array $data = [], array $query_params = [], $is_absolute = false )
get ( $name )
getResponse ( )
isPost ( )
json ( array $vars, string | null $charset = 'utf-8' ) : string Helper method to respond JSON.
query ( $name, $default = null )
redirect ( $uri, $code = 302 )
render ( $name, array $vars = [] )

Method Details

__construct() public method

public __construct ( Pimple\Container $container )
$container Pimple\Container

body() protected method

protected body ( $name = null, $default = null )

findTemplate() protected method

protected findTemplate ( $name )

generateUrl() protected method

protected generateUrl ( $handler, array $data = [], array $query_params = [], $is_absolute = false )
$data array
$query_params array

get() protected method

protected get ( $name )

getResponse() protected method

protected getResponse ( )

isPost() protected method

protected isPost ( )

json() protected method

Helper method to respond JSON.
protected json ( array $vars, string | null $charset = 'utf-8' ) : string
$vars array
$charset string | null
return string JSON encoded string

query() protected method

protected query ( $name, $default = null )

redirect() protected method

protected redirect ( $uri, $code = 302 )

render() protected method

protected render ( $name, array $vars = [] )
$vars array

setVars() public method

public setVars ( $key, $value = null )

Property Details

$container protected_oe property

protected $container

$view_vars protected_oe property

protected $view_vars