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

administrator
Site Admin
Site Admin
Posts: 5922
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO define page META tags from view file?

Postby administrator » 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;

Return to “ApPHP Directy CMF {developers/users}”