#Yii_tips: Setting meta tags in view in Yii framework


Updated July 12, 2013 ● 2,117 views
If you wonder how to set the meta tags in view in Yii framework, it's very simple. Just  call Yii::app()->clientScript->registerMetaTag() function.

For example:

To set meta description:
Yii::app()->clientScript->registerMetaTag("The description", "description");
To set meta keywords:
Yii::app()->clientScript->registerMetaTag("The, keywords, etc.", "keywords");

4 Comments

Sort by Best Controversial New
 
3

I think Yii is a very good PHP framework. I used to use Joomla but ir's a CMS. Too many unwanted features. I'd rather create from scratch and Yii provides goodstarting point.

RobZ · 7 years ago
permalink · reply (1)
1

@RobZ: funny i used to work with Joomla too. Now full pledge Yii fan. Follow me so we can share Yii ideas.

master_yii · 7 years ago
permalink · reply
1

Yii is the best PHP framework. Thanks for this tip.

Prakash1 · 7 years ago
permalink · reply (0)
1

All of a sudden I got the Yii Novice badge for this old post. Looks like  a couple of Yii developers signed up. Thanks. Please feel free to cooment.

master_yii · 7 years ago
permalink · reply (0)

Our Terms of Use and Privacy Policy have changed.
By continuing to use this site, you are agreeing to the new Privacy Policy and Terms of Service.