/** * 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(); }
/** * @return string */ public function render() { if ($this->isEmpty()) { return ''; } return Markup::meta('name', $this->name, $this->content)->render(); }
/** * @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); }
public function __construct($title = '', $siteName = '') { $this->title = $title; $this->siteName = $siteName; $this->tag = Markup::title(); }