Example #1
0
 /**
  * Generates a link to a namespace.
  *
  * @param  array  $context    Template context.
  * @param  string $namespace  Namespace to link to.
  *
  * @return string
  */
 public function linkNamespace($context, $namespace)
 {
     if (!isset($context['_genry_page']) || !$context['_genry_page'] instanceof Page) {
         throw new \RuntimeException('Twig link_namespace() function requires "_genry_page" variable in the template to be set' . ' to the current rendered page. It must have been overwritten in the context.');
     }
     return $this->router->generateNamespaceLink($namespace, $context['_genry_page']);
 }