Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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 ?



294
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)



4.7k

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