public function __construct($manifest, $config, $files, $line, $tag = null) { parent::__construct(array(), array(), $line, $tag); $this->manifest = $manifest; $this->config = $config; $this->files = $files; }
public function __construct(Twig_Node_Expression $expr, $sandboxed, $variables, $lineno, $tag = null) { parent::__construct($lineno, $tag); $this->expr = $expr; $this->sandboxed = $sandboxed; $this->variables = $variables; }
public function __construct($count, Twig_NodeList $body, $plural, $lineno, $tag = null) { parent::__construct($lineno, $tag); $this->count = $count; $this->body = $body; $this->plural = $plural; }
public function __construct($name, $imitates, $settings, $lineNo) { parent::__construct(array(), array(), $lineNo); $this->name = $name; $this->imitates = $imitates; $this->settings = $settings; }
public function __construct(Context $context, $type, $resource, $lineno, $tag) { parent::__construct([], [], $lineno, $tag); $this->type = $type; $this->resource = $resource; $this->context = $context; }
public function __construct($name, $vars, $lineNo) { parent::__construct(array(), array(), $lineNo); $this->name = $name; $this->vars = $vars; }
/** * Constructor * * @param string $lineno * @param string $method * @param string $files * @param string $options * @author Jonathan Geiger */ public function __construct($lineno, $method, $files, $options = NULL) { parent::__construct($lineno); $this->method = $method; $this->files = $files; $this->options = $options; }
public function __construct($isMultitarget, $names, $values, $lineno, $tag = null) { parent::__construct($lineno, $tag); $this->isMultitarget = $isMultitarget; $this->names = $names; $this->values = $values; }
/** * @param string $lineno * @param string $tag * @param string $key * @param string $lifetime * @param string $data * @author Jonathan Geiger */ public function __construct($lineno, $tag, $key, $lifetime, $data) { parent::__construct($lineno); $this->key = $key; $this->data = $data; $this->lifetime = $lifetime; }
public function __construct(array $usedFilters, array $usedTags, array $usedFunctions) { $this->usedFilters = $usedFilters; $this->usedTags = $usedTags; $this->usedFunctions = $usedFunctions; parent::__construct(); }
public function __construct($name, Twig_NodeList $body, $lineno, $parent = null, $tag = null) { parent::__construct($lineno, $tag); $this->name = $name; $this->body = $body; $this->parent = $parent; }
/** * @param string $lineno * @param string $tag * @param string $method * @param string $params * @author Jonathan Geiger */ public function __construct($lineno, $tag, $method, $params = array()) { parent::__construct($lineno); $this->tag = $tag; $this->method = $method; $this->params = $params; }
public function __construct(AssetInterface $asset, \Twig_NodeInterface $body, $attributes, $lineno = 0, $tag = null) { $nodes = array('body' => $body); $attributes['asset'] = $asset; $attributes['var_name'] = 'asset_url'; parent::__construct($nodes, $attributes, $lineno, $tag); }
/** * @param array $entityType * @param \Twig_NodeInterface $ids * @param string $viewMode * @param null $langcode * @param null $page * @param int $lineno * @param null $tag */ public function __construct($entityType, \Twig_NodeInterface $ids, $viewMode = 'full', $langcode = null, $page = null, $lineno = 0, $tag = null) { $nodes = array(); // Load the entities by type and an array of IDs. // Assemble arguments for entity_load(). $argumentsNodes = array(); $argumentsNodes[] = $entityTypeNode = new \Twig_Node_Expression_Constant($entityType, $lineno); $argumentsNodes[] = $ids; // Construct call to entity_load() and capture the result in temporary // variable named `entities`. $valuesNode = new \Twig_Node(array(new \Twig_Node_Expression_Function('entity_load', new \Twig_Node($argumentsNodes), $lineno))); $entitiesNamesNode = new \Twig_Node(array(new \Twig_Node_Expression_TempName('entities', $lineno))); $nodes[] = new \Twig_Node_Set(false, $entitiesNamesNode, $valuesNode, $lineno); // Assemble arguments for entity_view() $argumentsNodes = array(); $argumentsNodes[] = $entityTypeNode; $argumentsNodes[] = $entitiesNamesNode; $argumentsNodes[] = new \Twig_Node_Expression_Constant($viewMode, $lineno); $argumentsNodes[] = new \Twig_Node_Expression_Constant($langcode, $lineno); $argumentsNodes[] = new \Twig_Node_Expression_Constant($page, $lineno); // Construct call to entity_view() and capture the result in // temporary variable named `output`. $valuesNode = new \Twig_Node(array(new \Twig_Node_Expression_Function('entity_view', new \Twig_Node($argumentsNodes), $lineno))); $outputNamesNode = new \Twig_Node(array(new \Twig_Node_Expression_TempName('output', $lineno))); $nodes[] = new \Twig_Node_Set(false, $outputNamesNode, $valuesNode, $lineno); // Assemble arguments for drupal_render(). $argumentsNodes = array(); $argumentsNodes[] = $outputNamesNode; // Construct call to drupal_render() and echo the result. $expr = new \Twig_Node_Expression_Function('drupal_render', new \Twig_Node($argumentsNodes), $lineno); $nodes[] = new \Twig_Node_Print($expr, $lineno); // Pass the original arguments up. $attributes = array('entity_type' => $entityType, 'view_mode' => $viewMode, 'langcode' => $langcode, 'page' => $page); parent::__construct($nodes, $attributes, $lineno, $tag); }
public function __construct($isMultitarget, $names, Twig_Node_Expression $value, $lineno, $tag = null) { parent::__construct($lineno, $tag); $this->isMultitarget = $isMultitarget; $this->names = $names; $this->value = $value; }
/** * @param integer $lineno * @param string $tag */ public function __construct(\Twig_Node $variable, \Twig_Node $collectionType, \Twig_Node_Expression_Filter $collectionFilters = null, \Twig_Node_Expression $parameters = null, \Twig_Node_Expression $ifExpression = null, \Twig_NodeInterface $else = null, \Twig_NodeInterface $body, $lineno, $tag = null) { $body = new \Twig_Node(array($body, $this->loop = new \Twig_Node_ForLoop($lineno, $tag))); if (null !== $ifExpression) { $body = new \Twig_Node_If(new \Twig_Node(array($ifExpression, $body)), null, $lineno, $tag); } parent::__construct(array('variable' => $variable, 'collectionType' => $collectionType, 'collectionFilters' => $collectionFilters, 'parameters' => $parameters, 'ifExpression' => $ifExpression, 'else' => $else, 'body' => $body), array('with_loop' => true, 'ifexpr' => null !== $ifExpression), $lineno, $tag); }
public function __construct($name, $method, \Twig_NodeList $arguments, $echo, $lineno, $tag = null) { parent::__construct($lineno, $tag); $this->name = $name; $this->method = $method; $this->arguments = $arguments; $this->echo = $echo; }
/** * @param array $placeholder Array with placeholder data * @param $variables Additional placeholder data * @param string $wrapClassName css class name for items wrapper * @param int $line Line * @param int $tag twig tag */ public function __construct(array $placeholder, $variables, $wrapClassName, $line, $tag) { $items = isset($placeholder['items']) ?: []; parent::__construct([], ['value' => $items], $line, $tag); $this->placeholder = $placeholder; $this->wrapClassName = $wrapClassName; $this->variables = $variables; }
/** * @param \Twig_Node_Expression $name * @param \Twig_Node_Expression $parameters * @param \Twig_NodeInterface $body * @param int $lineno * @param string $tag */ public function __construct(\Twig_Node $name, \Twig_Node_Expression $parameters = null, \Twig_NodeInterface $body, $lineno, $tag = null) { $nodes = ['name' => $name, 'body' => $body]; if (!is_null($parameters)) { $nodes['parameters'] = $parameters; } parent::__construct($nodes, [], $lineno, $tag); }
public function __construct(Twig_Node $body, Twig_Node $variables = null, $only = false, $lineno, $tag = null) { $nodes = array('body' => $body); if (null !== $variables) { $nodes['variables'] = $variables; } parent::__construct($nodes, array('only' => (bool) $only), $lineno, $tag); }
public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) { $nodes = array('expr' => $expr); if (null !== $variables) { $nodes['variables'] = $variables; } parent::__construct($nodes, array('only' => (bool) $only, 'ignore_missing' => (bool) $ignoreMissing), $lineno, $tag); }
public function __construct(\Twig_NodeInterface $body, $language, $variables = [], $ignoreErrors = false, $lineno, $tag = 'highlight') { $nodes = ['body' => $body, 'language' => $language]; if (!is_array($variables)) { $nodes['variables'] = $variables; } parent::__construct($nodes, ['ignoreErrors' => $ignoreErrors], $lineno, $tag); }
public function __construct(Twig_Node $tests, Twig_Node $else = null, $lineno, $tag = null) { $nodes = array('tests' => $tests); if (null !== $else) { $nodes['else'] = $else; } parent::__construct($nodes, array(), $lineno, $tag); }
public function __construct(Twig_Node_Expression_AssignName $keyTarget, Twig_Node_Expression_AssignName $valueTarget, Twig_Node_Expression $seq, Twig_Node_Expression $ifexpr = null, Twig_NodeInterface $body, Twig_NodeInterface $else = null, $lineno, $tag = null) { $body = new Twig_Node(array($body, $this->loop = new Twig_Node_ForLoop($lineno, $tag))); if (null !== $ifexpr) { $body = new Twig_Node_If(new Twig_Node(array($ifexpr, $body)), null, $lineno, $tag); } parent::__construct(array('key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body, 'else' => $else), array('with_loop' => true, 'ifexpr' => null !== $ifexpr), $lineno, $tag); }
/** * Constructor. * * The following attributes are required: * * * output: The asset output string * * name: A name of the asset * * The following attributes are optional: * * * debug: The debug mode * * var_name: The name of the variable to expose to the body node * * @param Twig_NodeInterface $body The body node * @param array $inputs An array of input strings * @param array $filters An array of filter strings * @param array $attributes An array of attributes * @param integer $lineno The line number * @param string $tag The tag name */ public function __construct(\Twig_NodeInterface $body, array $inputs, array $filters, array $attributes, $lineno = 0, $tag = null) { $nodes = array('body' => $body); $attributes = array_replace(array('debug' => false, 'var_name' => 'asset_url'), $attributes, array('inputs' => $inputs, 'filters' => $filters)); if ($diff = array_diff(array('output', 'name'), array_keys($attributes))) { throw new \InvalidArgumentException('AsseticNode requires the following attribute(s): ' . implode(', ', $diff)); } parent::__construct($nodes, $attributes, $lineno, $tag); }
public function __construct($name, Twig_Node $body, Twig_Node $arguments, $lineno, $tag = null) { foreach ($arguments as $argumentName => $argument) { if (self::VARARGS_NAME === $argumentName) { throw new Twig_Error_Syntax(sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getLine()); } } parent::__construct(array('body' => $body, 'arguments' => $arguments), array('name' => $name), $lineno, $tag); }
public function __construct($manifest, $config, \Twig_NodeInterface $body, $files, $line, $tag = null) { $nodes = array('body' => $body); $attributes = array('var_name' => 'asset_url'); $this->_manifest = $manifest; $this->_config = $config; $this->_files = $files; parent::__construct($nodes, $attributes, $line, $tag); }
public function __construct($varPrefix, \Twig_Node $values = null, $lineno, $tag = null) { $nodes = array(); if (null !== $values) { $nodes['values'] = $values; } parent::__construct($nodes, array(), $lineno, $tag); $this->varPrefix = $varPrefix; }
public function __construct(Twig_NodeInterface $body, Twig_Node_Expression $parent = null, Twig_NodeInterface $blocks, Twig_NodeInterface $macros, Twig_NodeInterface $traits, $embeddedTemplates, $filename, $source = '') { $nodes = array('body' => $body, 'blocks' => $blocks, 'macros' => $macros, 'traits' => $traits, 'display_start' => new Twig_Node(), 'display_end' => new Twig_Node(), 'constructor_start' => new Twig_Node(), 'constructor_end' => new Twig_Node(), 'class_end' => new Twig_Node()); if (null !== $parent) { $nodes['parent'] = $parent; } // embedded templates are set as attributes so that they are only visited once by the visitors parent::__construct($nodes, array('source' => $source, 'filename' => $filename, 'index' => null, 'embedded_templates' => $embeddedTemplates), 1); }
public function __construct($isMultitarget, $item, $seq, Twig_NodeList $body, Twig_Node $else = null, $lineno, $tag = null) { parent::__construct($lineno, $tag); $this->isMultitarget = $isMultitarget; $this->item = $item; $this->seq = $seq; $this->body = $body; $this->else = $else; $this->lineno = $lineno; }