Author: Gawain Lynch (gawain.lynch@gmail.com)
Author: Bob den Otter (bob@twokings.nl)
Inheritance: implements Bolt\Asset\QueueInterface
Beispiel #1
0
 /**
  * Add base snippets to the response.
  */
 protected function addSnippets()
 {
     $this->queue->add(Target::END_OF_HEAD, '<meta name="generator" content="Bolt">');
     if ($this->config->get('general/canonical')) {
         $canonical = $this->resources->getUrl('canonicalurl');
         $this->queue->add(Target::END_OF_HEAD, $this->encode('<link rel="canonical" href="%s">', $canonical));
     }
     if ($favicon = $this->config->get('general/favicon')) {
         $host = $this->resources->getUrl('hosturl');
         $theme = $this->resources->getUrl('theme');
         $this->queue->add(Target::END_OF_HEAD, $this->encode('<link rel="shortcut icon" href="%s%s%s">', $host, $theme, $favicon));
     }
 }
Beispiel #2
0
 /**
  * Add base snippets to the response.
  */
 protected function addSnippets()
 {
     $generatorSnippet = (new Snippet())->setLocation(Target::END_OF_HEAD)->setCallback('<meta name="generator" content="Bolt">');
     $this->queue->add($generatorSnippet);
     $canonicalUrl = $this->canonical->getUrl();
     $canonicalSnippet = (new Snippet())->setLocation(Target::END_OF_HEAD)->setCallback($this->encode('<link rel="canonical" href="%s">', $canonicalUrl));
     $this->queue->add($canonicalSnippet);
     if ($favicon = $this->config->get('general/favicon')) {
         $faviconUrl = $this->packages->getUrl($favicon, 'theme');
         $faviconSnippet = (new Snippet())->setLocation(Target::END_OF_HEAD)->setCallback($this->encode('<link rel="shortcut icon" href="%s">', $faviconUrl));
         $this->queue->add($faviconSnippet);
     }
 }