We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Call Phalcon function Tag

I want to call Tag Phalcon function, with Tag.

I saw many example on internet with this :

use Phalcon\Tag as Tag;

But to have access to Tag, you must put this in all phtml file : https://github.com/phalcon/php-site/blob/master/app/views/news/showYear.phtml

Can we put this syntax in one file, and it will be available in the project everywhere ?



300
Accepted
answer

you can also use it as $this->tag in view, if its cleaner that way for you, like:

$this->tag->linkTo('news/'.$new->getUri(), $new->title)



7.9k

It's ok, the syntax is clean like this.