Hey,
I use Yii2 to generate Web-Application sites. Now, I need to set a global Meta-Tag to each website that is generated by Yii2.
So the question is: what is the right place for registerMetaTag() to reach all pages and to avoid duplicated calls.
It looks like the controller is not the right place, because I have many controllers and I don’t like to define that meta-tag in each controller again and again.
Also the main-layout view is not the right place, because, the layout should be interchangeable. So I need to hold the changes in views/layouts/main.php (etc) small as possible. Otherwise I have to apply all additional Yii stuff to new layout-templates.
Next option: the web/index.php, which looks very basic, not the right place for application-specific code, isn’t it?
So where is the best location to place an global metaTag?
Thank you.