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.

how to put another html attributes in link_to

how to put another html attributes in link_to method because like for example i have html tags <a href="#">Link to another <i class="glyphicon glyphicon-user"></i> </a>



1.4k

try escaping the quotes



16.8k
Accepted
answer

So you want something like this?

<a href='#' class='myClass' id='myId'>
    Link to another
    <i class='glyphicon glyphicon-user'></i>
</a>

Just do:

Phalcon\Tag::linkTo(
    '#',
    "Link to another<i class='glyphicon glyphicon-user'></i>",
    ['class' => 'myClass', 'id' => 'myId']
);

http://docs.phalconphp.com/es/latest/api/Phalcon%5Tag.html

So you want something like this?

``` <a href='#' class='myClass' id='myId'> Link to another <i class='glyphicon glyphicon-user'></i> </a> ```

Just do:

``` Phalcon\Tag::linkTo( '#', "Link to another<i class='glyphicon glyphicon-user'></i>", ['class' => 'myClass', 'id' => 'myId'] ); ```

http://docs.phalconphp.com/es/latest/api/Phalcon%5Tag.html

thank you for your help :) its nice and concise