/** * Add links to header. * * @return void */ protected function addLinks() { // Convenient shortcut to view helper: $headLink = $this->getView()->plugin('headlink'); // Load CSS (make sure we prepend them in the appropriate order; theme // resources should load before extras added by individual templates): foreach (array_reverse($this->container->getCss()) as $current) { $parts = $this->parseSetting($current); $headLink()->prependStylesheet(trim($parts[0]), isset($parts[1]) ? trim($parts[1]) : 'all', isset($parts[2]) ? trim($parts[2]) : false); } // Compile and load LESS (make sure we prepend them in the appropriate order // theme resources should load before extras added by individual templates): foreach (array_reverse($this->container->getLessCss()) as $current) { $parts = $this->parseSetting($current); $headLink()->prependStylesheet($headLink()->addLessStylesheet(trim($parts[0])), isset($parts[1]) ? trim($parts[1]) : 'all', isset($parts[2]) ? trim($parts[2]) : false); } // If we have a favicon, load it now: $favicon = $this->container->getFavicon(); if (!empty($favicon)) { $imageLink = $this->getView()->plugin('imagelink'); $headLink(['href' => $imageLink($favicon), 'type' => 'image/x-icon', 'rel' => 'shortcut icon']); } }
/** * Test Favicon set/get. * * @return void */ public function testFavicon() { $container = new ResourceContainer(); $container->setFavicon('fake'); $this->assertEquals('fake', $container->getFavicon()); }