Coerce
extends BaseFilter
in package
Typeless languages are kind of a pain. This filter allows you to coerce a twig variable into a fixed primitive type.
Coercion filters:
- string
- int
- float
- bool
Uses PHP type coercion internally.
{{ 'foo/bar'|url({'a': 1}) }} becomes /foo/bar?a=1
Table of Contents
- __construct() : mixed
- getDI() : object
- Return default dependency injector
- getFilterName() : string
- Return the filter name
- getFilterOptions() : mixed
- handle() : string
- Handle filter response
Methods
__construct()
public
__construct() : mixed
Return values
mixed —getDI()
Return default dependency injector
public
getDI() : object
Return values
object —Phalcon\Di
getFilterName()
Return the filter name
public
getFilterName() : string
Return values
string —getFilterOptions()
public
getFilterOptions() : mixed
Return values
mixed —handle()
Handle filter response
public
handle(mixed $var, mixed $coerce) : string
Parameters
- $var : mixed
- $coerce : mixed