TwigExtension::getLink

public TwigExtension::getLink($text, $url, $attributes = []) Gets a rendered link from a url object. Parameters string $text: The link text for the anchor tag as a translated string. \Drupal\Core\Url|string $url: The URL object or string used for the link. array|\Drupal\Core\Template\Attribute $attributes: An optional array or Attribute object of link attributes. Return value array A render array representing a link to the given URL. File core/lib/Drupal/Core/Template/TwigExtension.php, line

TwigExtension::getName

public TwigExtension::getName() File core/lib/Drupal/Core/Template/TwigExtension.php, line 199 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function getName() { return 'drupal_core'; }

TwigExtension::getNodeVisitors

public TwigExtension::getNodeVisitors() File core/lib/Drupal/Core/Template/TwigExtension.php, line 179 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function getNodeVisitors() { // The node visitor is needed to wrap all variables with // render_var -> TwigExtension->renderVar() function. return array( new TwigNodeVisitor(), ); }

TwigExtension::getPath

public TwigExtension::getPath($name, $parameters = array(), $options = array()) Generates a URL path given a route name and parameters. Parameters $name: The name of the route. array $parameters: An associative array of route parameters names and values. array $options: (optional) An associative array of additional options. The 'absolute' option is forced to be FALSE. Return value string The generated URL path (relative URL) for the given route. See also \Drupal\Core\Routing\UrlGeneratorInte

TwigExtension::getTokenParsers

public TwigExtension::getTokenParsers() File core/lib/Drupal/Core/Template/TwigExtension.php, line 190 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function getTokenParsers() { return array( new TwigTransTokenParser(), ); }

TwigExtension::getUrl

public TwigExtension::getUrl($name, $parameters = array(), $options = array()) Generates an absolute URL given a route name and parameters. @todo Add an option for scheme-relative URLs. Parameters $name: The name of the route. array $parameters: An associative array of route parameter names and values. array $options: (optional) An associative array of additional options. The 'absolute' option is forced to be TRUE. Return value string The generated absolute URL for the given route. File core/

TwigExtension::isUrlGenerationSafe

public TwigExtension::isUrlGenerationSafe(\Twig_Node $args_node) Determines at compile time whether the generated URL will be safe. Saves the unneeded automatic escaping for performance reasons. The URL generation process percent encodes non-alphanumeric characters. Thus, the only character within a URL that must be escaped in HTML is the ampersand ("&") which separates query params. Thus we cannot mark the generated URL as always safe, but only when we are sure there won't be multiple quer

TwigExtension::renderVar

public TwigExtension::renderVar($arg) Wrapper around render() for twig printed output. If an object is passed which does not implement __toString(), RenderableInterface or toString() then an exception is thrown; Other objects are casted to string. However in the case that the object is an instance of a Twig_Markup object it is returned directly to support auto escaping. If an array is passed it is rendered via render() and scalar values are returned directly. Parameters mixed $arg: String, Obj

TwigExtension::safeJoin

public TwigExtension::safeJoin(\Twig_Environment $env, $value, $glue = '') Joins several strings together safely. Parameters \Twig_Environment $env: A Twig_Environment instance. mixed[]|\Traversable|null $value: The pieces to join. string $glue: The delimiter with which to join the string. Defaults to an empty string. This value is expected to be safe for output and user provided data should never be used as a glue. Return value string The strings joined together. File core/lib/Drupal/Core/Te

TwigExtension::setDateFormatter

public TwigExtension::setDateFormatter(DateFormatterInterface $date_formatter) Sets the date formatter. Parameters \Drupal\Core\Datetime\DateFormatter $date_formatter: The date formatter. Return value $this File core/lib/Drupal/Core/Template/TwigExtension.php, line 115 Class TwigExtension A class providing Drupal Twig extensions. Namespace Drupal\Core\Template Code public function setDateFormatter(DateFormatterInterface $date_formatter) { $this->dateFormatter = $date_formatter;