You are here

public function Twig_Node::getAttribute in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Node.php \Twig_Node::getAttribute()

Gets an attribute.

Parameters

string The attribute name:

Return value

mixed The attribute value

23 calls to Twig_Node::getAttribute()
Twig_Node_BlockReference::compile in vendor/Twig/Node/BlockReference.php
Compiles the node to PHP.
Twig_Node_Expression_BlockReference::compile in vendor/Twig/Node/Expression/BlockReference.php
Compiles the node to PHP.
Twig_Node_Expression_Call::compileArguments in vendor/Twig/Node/Expression/Call.php
Twig_Node_Expression_Call::compileCallable in vendor/Twig/Node/Expression/Call.php
Twig_Node_Expression_Call::getArguments in vendor/Twig/Node/Expression/Call.php

... See full list

File

vendor/Twig/Node.php, line 141

Class

Twig_Node
Represents a node in the AST.

Code

public function getAttribute($name) {
  if (!array_key_exists($name, $this->attributes)) {
    throw new LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, get_class($this)));
  }
  return $this->attributes[$name];
}