assert($this->urlGeneratorinstanceofUrlGeneratorInterface,"The URL generator hasn't been set up. Any configuration YAML file with a service directive dealing with the Twig configuration can cause this, most likely found in a recently installed or changed module.");
assert($this->urlGeneratorinstanceofUrlGeneratorInterface,"The URL generator hasn't been set up. Any configuration YAML file with a service directive dealing with the Twig configuration can cause this, most likely found in a recently installed or changed module.");
@@ -277,6 +281,9 @@ public function getUrl($name, $parameters = [], $options = []) {
* A render array representing a link to the given URL.
*/
publicfunctiongetLink($text,$url,$attributes=[]){
assert(is_string($url)||$urlinstanceofUrl,'$url must be a string or object of type \Drupal\Core\Url');
assert(is_array($attributes)||$attributesinstanceofAttribute,'$attributes, if set, must be an array or object of type \Drupal\Core\Template\Attribute');
if(!$urlinstanceofUrl){
$url=Url::fromUri($url);
}
...
...
@@ -374,6 +381,8 @@ public function isUrlGenerationSafe(\Twig_Node $args_node) {
* An asset library.
*/
publicfunctionattachLibrary($library){
assert(is_string($library),'Argument must be a string.');
// Use Renderer::render() on a temporary render array to get additional