D
D
dicem2018-03-02 16:01:48
CakePHP
dicem, 2018-03-02 16:01:48

How to insert a tag into a link in cakephp using the html helper?

How to add a tag to the link in cakephp using the html helper , since it is needed for correct layout?
I drink it like this:

Html->link('Войти',['controller'=>'Users','action'=>'login']); ?>

Returns the tag as needed
<a href="login">Войти</a>
<a href="login"><i></i>Войти</a>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Marat Dallin, 2018-03-22
@dicem

echo $this->Html->link(
    $this->Html->tag('i', '') . 'Войти', 
    ['controller' => 'Users', 'action' => 'login'],
    ['escape' => false]
);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question