HOW TO define page META tags from view file?

Discuss everything related to ApPHP Durecty CMF. All versions. Any questions related to the Directy CMF developing or using should be posted to this forum.

Moderators: ne_moj, alexmst, zewa

HOW TO define page META tags from view file?

Postby administrator on Dec 18th, '15, 20:22

To define page META tags from view file or from controller you may use following code:
Code: Select all
Website::setMetaTags(array(
   'title'=>'Page Title',
   'keywords'=>'your, keywords, here',
   'description'=>'Page Description',
));


or directly (only from view file):

Code: Select all
$this->_pageTitle = ';
$this->_pageKeywords = ';
$this->_pageKeywords = '';


Also, if you need to define some variable from view file, that will be visible on default page or header, you may define in view file in following format:
Code: Select all
$this->siteTitle = A::t('portal', 'Buyer Login');


and show it on template file with:
Code: Select all
echo $siteTitle;
User avatar
administrator
Site Admin
Site Admin
 
Posts: 5905
Joined: Jan 7th, '09, 23:18

Return to ApPHP Directy CMF {developers/users}

Who is online

Users browsing this forum: No registered users and 1 guest

cron