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

How make this in volt syntax?

How can i do this in volt syntax:

Span inside{{ link_to() }}?

<a href="link.html" class="my-class"><span class="my-class"></span></a>

Image inside {{ link_to() }}?

<a href="link.html"><img alt="" src="my_image.jpg"></a>

{{link_to('link/something','class':'my-class','<span class="my-class">something here</span>'}}

and image is still they same :) thank you



21.5k
Accepted
answer

Maybe you can use an alternative url('link/something'):

<a href="{{ url('link/something')  }}" class="my-class"><span class="my-class"></span></a>
<a href="{{ url('link/something')  }}"><img alt="" src="my_image.jpg"></a>

I had tried it but did not work

{{link_to('link/something','class':'my-class','<span class="my-class">something here</span>'}}

and image is still they same :) thank you

This way works perfectly :)

Maybe you can use an alternative url('link/something'):

<a href="{{ url('link/something')  }}" class="my-class"><span class="my-class"></span></a>
<a href="{{ url('link/something')  }}"><img alt="" src="my_image.jpg"></a>

im sorry i forgot the other parenthesis {{link_to('link/something','class':'my-class','<span class="my-class">something here</span>')}}

just try this and thank me :)

Thank you man :D

Maybe you can use an alternative url('link/something'):

<a href="{{ url('link/something')  }}" class="my-class"><span class="my-class"></span></a>
<a href="{{ url('link/something')  }}"><img alt="" src="my_image.jpg"></a>