Hi guys,
I try to add registerMetaTag in my controller but it doesn’t appear in my view.
Here is my code
\Yii::$app->view->registerMetaTag([ 'name' => 'description', 'content' => Yii::t('seo', '__desc_home'), ]);
My view
<?= $this->render('_head');?> <?php echo $content;?> <?= $this->render('_footer');?>
My _head.php
<?php
use \yii\helpers\Html;
?><?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language; ?>">
<head>
<?php $this->head() ?></head>
<body>
<?php $this->beginBody() ?>
My _footer.php
<?php
use \yii\helpers\Html;
?>
<script src="/vendor/jquery-3.1.1.min.js"></script>
<script src="/vendor/jquery.touchSwipe.min.js"></script>
<script src="/js/bundle.js"></script>
<?php $this->endBody(); ?>
</body>
<?php $this->endPage() ?>
</html>
After rendering
<! DOCTYPE html> <html lang="en-UK"> <head> **<![CDATA[YII-BLOCK-HEAD]]>**
I guess there is a problem of calling endbody() and endpage().
They are not in the same file. Does anybody has a tip?
thx!!