Bolt\Asset\Snippet\Queue::add PHP Метод

add() публичный Метод

Insert a snippet. And by 'insert' we actually mean 'add it to the queue, to be processed later'.
public add ( Bolt\Asset\Snippet\SnippetAssetInterface $snippet )
$snippet Bolt\Asset\Snippet\SnippetAssetInterface
    public function add(SnippetAssetInterface $snippet)
    {
        $this->queue[] = $snippet;
    }

Usage Example

Пример #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));
     }
 }
All Usage Examples Of Bolt\Asset\Snippet\Queue::add