/** * register metaTags and JsonLD info * @param array $data */ public function registerMetaTagJsonLD($data = []) { $this->view->title = !empty($data['title']) ? $data['title'] : Yii::$app->name; if (!empty($data['jsonLd'])) { JsonLDHelper::add($data['jsonLd']); } if (!empty($data['metaTags'])) { foreach ($data['metaTags'] as $tag) { $this->view->registerMetaTag($tag); } } }
<?php /* @var $this \yii\web\View */ /* @var $content string */ use common\widgets\SideMenu; use common\widgets\Alert; use frontend\assets\AppAsset; use modernkernel\fontawesome\Icon; use modernkernel\themeadminlte\AdminlteAsset; use nirvana\jsonld\JsonLDHelper; AdminlteAsset::register($this); AppAsset::register($this); JsonLDHelper::addBreadcrumbList(); $this->beginContent('@common/layouts/base.php'); ?> <body class="hold-transition skin-blue sidebar-mini"> <?php $this->beginBody(); ?> <div class="wrapper"> <header class="main-header"> <a href="<?php echo Yii::$app->urlManager->createUrl(['/site/index']); ?> " class="logo" target="_blank"> <!-- mini logo for sidebar mini 50x50 pixels --> <span class="logo-mini"> <img src="/images/logo-mini.svg" class="img-responsive" style="max-height: 20px; max-width: 20px; margin: 15px;" alt="<?php echo Yii::$app->name; ?>
<![endif]--> <?php echo Html::csrfMetaTags(); ?> <title><?php echo Html::encode($this->title); ?> </title> <?php $this->head(); ?> <?php echo Favicon::widget(); ?> <?php JsonLDHelper::registerScripts(); ?> <?php GAnalytics::register(); ?> <?php Addthis::register(); ?> <?php HeaderJS::register(); ?> </head> <?php echo $content; ?> </html>