16 '_context' =>
'$context',
17 '_charset' =>
'$this->env->getCharset()',
22 parent::__construct(array(), array(
'name' => $name,
'is_defined_test' =>
false,
'ignore_strict_check' =>
false,
'always_defined' =>
false),
$lineno);
31 $compiler->
repr(
true);
33 $compiler->
raw(
'array_key_exists(')->repr($name)->raw(
', $context)');
36 $compiler->
raw($this->specialVars[$name]);
47 if (version_compare(phpversion(),
'5.4.0RC1',
'>=')) {
50 ->
raw(
'(isset($context[')
52 ->raw(
']) ? $context[')
58 $compiler->
raw(
'null)');
60 $compiler->
raw(
'$this->getContext($context, ')->string($name)->raw(
'))');
64 ->
raw(
'$this->getContext($context, ')
69 $compiler->
raw(
', true');
81 return isset($this->specialVars[$this->
getAttribute(
'name')]);
Compiles a node to PHP code.
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
__construct($name, $lineno)
getAttribute($name)
Gets an attribute.
if(strlen($date2)== '10') if($type== 'users-by-age'&&a_priv('admin_users', true)) elseif($type== 'forums-count'&&a_priv('admin_content', true)) elseif($type== 'forums-categories'&&a_priv('admin_content', true)) elseif($type== 'users-count'&&a_priv('admin_users', true)) elseif($type== 'product-categories'&&a_priv('admin_products', true)) elseif($type== 'users-by-sex'&&a_priv('admin_users', true)) elseif($type== 'users-by-country'&&a_priv('admin_users', true)) elseif($type== 'sales'&&a_priv('admin_sales', true))
Abstract class for all nodes that represents an expression.
getEnvironment()
Returns the environment instance related to this compiler.
repr($value)
Returns a PHP representation of a given value.
raw($string)
Adds a raw string to the compiled code.