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 do I express in phtml {{url ('') }} ?

I want to use {{url ('')}} in my phtml forms but can not find the correct syntax as express this: ``` <div align="right"> {{ linkto("spmcontacto/new", "<img src='{{ url('img/tolbar/Package-accept-icon.png') }}'> Añadir un nuevo Empleado") }} </div> ```

edited Oct '15

for url

$this->url->get("products/search")

for link_to

$this->tag->linkTo("products/search", "Search")

https://docs.phalconphp.com/en/latest/reference/tags.html#generating-links



34.2k

How to join the two because I want to put the address of the image within link_to I want a link with a static imgen in all directions?

Maybe you want this:

<div align="right"><a href="{{ url('spmcontacto/new') }}" alt="Añadir un nuevo Empleado"><img src="{{ url('img/tolbar/Package-accept-icon.png') }}" /></a></div>


12.6k
Accepted
answer
edited Oct '15

volt

{{ link_to("spmcontacto/new", "<img src='"~url("img/tolbar/Package-accept-icon.png")~"'> Anadir un nuevo Empleado) }}

phtml

<?php echo $this->tag->linkTo("spmcontacto/new", "<img src='" . $this->url->get("img/tolbar/Package-accept-icon.png") . "'> Anadir un nuevo Empleado") ?>


34.2k

Thank you, yes run as needed, but it seems it is easier to work with volt but due to the syntax checker phtml use netbeans