ez.no / exponential / documentation / development / libraries / ez template / operators / type handling
These documentation pages are no longer maintained. Please visit the new documentation site.
These operators generally correspond to the PHP functions of the same name, where they exist.
Returns true if the input or the first parameter is an array. If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is a boolean (true or false). If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is an integer. If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is a floating point number. If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is a number or a numberic string (a string consisting of numbers). If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is a string. If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is an object (as opposed to a simple type like integer or float). If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is a class. If both input and parameter are supplied, the parameter will be used.
Returns true if the input or the first parameter is null.
Note: The integer 0 is not the same as 'null', if you want to test for 0 use
{$var|eq(0)}
or
{eq($var,0)}
instead. If both input and parameter are supplied, the parameter will be used.
Returns true if the first parameter is not false. is_set does not take an input.
Returns true if the first parameter is false. is_unset does not take an input.
Returns the type of the input or the first parameter as a string. If both input and parameter are supplied,
the parameter will be used. If the data is an object, then the string 'object' and the classname will be returned.
If
the data is an array, then the string 'array' and the array count will
be returned. If the data is a string, then the string 'string' and the
string length will be returned.
Returns the class of the input or the first parameter as a string. If
both input and parameter are supplied, the parameter will be used.
If the data is not an object, false will be returned.
Creates a true boolean. Remember to use brackets, e.g.
{true()}
Creates a false boolean. Remember to use brackets, e.g.
{false()}
Creates an array. E.g.
array(6,8,42)
Creates an associative array. E.g.
hash(name,'Ola Norman',age,26)
Some types can only be created from the PHP side or with the use of operators. Arrays are created with the array or the hash operator and booleans with the true and false operators.
{* Creating array with numerics *} {array(1,2,5)} {* Creating array with strings *} {array('red','green','blue')} {* Creating associative array *} {hash(name,'Ola Norman',age,26)} {* Creating booleans *} {true()} {false()} {* Creating array with booleans *} {array(true(),false(),true())}
Comments