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.

$this->tag->linkTo for relative uri

Hi,

In the html <a> element the href attribute can be for absolute or relative urls.

I would like to use:

echo $this->tag->linkTo($page->before,'<');

The problem I am having is this results in:

<a href="/myBaseUrl/5"> < </a>

When I need:

<a href="5"> < </a>

Is there a way to use $this->tag->linkTo in relative mode?



96.1k
Accepted
answer

Try this way:

echo $this->tag->linkTo(array($page->before,'<', 'local' => false));


42.9k

This no longer appears to work in Phalcon 2.0.3. My baseUri is appearing in the href.

echo $this->tag->linkTo(array($page->last,'>>', 'class' => 'paginator-button', 'local' => false));

Can anyone confirm?