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 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



13.2k
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'):

```php <a href="{{ url('link/something') }}" class="my-class"><span class="my-class"></span></a> ```

```php <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'):

```php <a href="{{ url('link/something') }}" class="my-class"><span class="my-class"></span></a> ```

```php <a href="{{ url('link/something') }}"><img alt="" src="my_image.jpg"></a> ```