Пример #1
0
 /**
  * @return Link
  */
 static function &add($name = null)
 {
     if (!$name) {
         $name = uniqid(microtime(true), true);
     }
     self::$links[$name] = \HtmlLink::setContent('');
     return self::$links[$name];
 }
Пример #2
0
 /**
  * @return \HtmlLink
  */
 function &addLink($url)
 {
     $key = __METHOD__ . $url;
     $this->items[$this->group][$key] = \HtmlLink::setHref($url);
     return $this->items[$this->group][$key];
 }
Пример #3
0
        $parameters[] = HtmlMeta::setAttribute('charset', $charset);
    }
    return $parameters;
});
/**
 * Favicons
 */
\Larakit\Event\Event::listener('lk-page::meta-tags', function (sfEvent $e, $parameters) {
    if (LaraPage::getFavicon() || LaraPage::getAppleTouchs()) {
        $parameters[] = '<!-- Favicons -->';
        if (LaraPage::getFavicon()) {
            $parameters[] = HtmlLink::setHref(LaraPage::getFavicon());
        }
        if (LaraPage::getAppleTouchs()) {
            foreach (LaraPage::getAppleTouchs() as $size => $url) {
                $link = HtmlLink::setRel('apple-touch-icon')->setHref($url);
                if ($size) {
                    $link->setAttribute('sizes', $size . 'x' . $size);
                }
                $parameters[] = $link;
            }
        }
    }
    return $parameters;
});
/**
 * Viewport
 */
\Larakit\Event\Event::listener('lk-page::meta-tags', function (sfEvent $e, $parameters) {
    $viewport = LaraPage::getViewport();
    if ($viewport) {