示例#1
0
 /**
  * Render meta tag
  *
  * @param  string $name
  * @param  string $content
  * @param  array  $attributes
  *
  * @return string
  */
 protected function renderMetaTag($name, $content, array $attributes = [])
 {
     if ($this->isEmpty()) {
         return '';
     }
     return Markup::meta('name', $name, $content, $attributes)->render();
 }
示例#2
0
文件: Meta.php 项目: arcanedev/head
 /**
  * @return string
  */
 public function render()
 {
     if ($this->isEmpty()) {
         return '';
     }
     return Markup::meta('name', $this->name, $this->content)->render();
 }
示例#3
0
 /**
  * @return array
  */
 public function toArray()
 {
     if ($this->isEmpty()) {
         return [];
     }
     $tags = [];
     // Check if .ico file exists
     //if ($this->isFaviconExists('ico')) {
     $tags[] = ['href' => $this->getIconPath(), 'rel' => 'icon', 'type' => 'image/x-icon'];
     //}
     // Check if .png file exists
     // if ($this->isFaviconExists('png')) {
     $tags[] = ['href' => $this->getImagePath(), 'rel' => 'icon', 'type' => 'image/png'];
     // }
     $tags = array_map(function ($attributes) {
         return Markup::make('link', $attributes)->render();
     }, $tags);
     return array_filter($tags);
 }
示例#4
0
文件: Title.php 项目: arcanedev/head
 public function __construct($title = '', $siteName = '')
 {
     $this->title = $title;
     $this->siteName = $siteName;
     $this->tag = Markup::title();
 }