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.

Volt image src from database

Hi again,

how can i set the image src from database:

{% for media in user.media %}

{{ image(media.image_1, "class":"img-responsive") }}

{% endfor %}

That is the generated html:

<img src="http://localhost:8000/projects/vokuro/clients/21/image_1/image_1.jpg" class="img-responsive">

The src is right, but the image can't be find, the permisions are set to 777.

KInd Regards

Stefan

What happened when you copy the src and put it in the url bar in the browser?



19.6k
edited Sep '15

Hi Bryan,

thank you for your fast reply, i get this:

Vokuro\Controllers\ClientsController handler class cannot be loaded
#0 [internal function]: Phalcon\Mvc\Dispatcher->_throwDispatchException('Vokuro\\Controll...', 2)
#1 [internal function]: Phalcon\Dispatcher->dispatch()
#2 C:\xampp\htdocs\projects\vokuro\public\index.php(33): Phalcon\Mvc\Application->handle()
#3 {main}

I must say, that I am using vokuro as base and clients is a directory, not a Controller.

Rgds

Stefan



19.6k
Accepted
answer
edited Sep '15

Hi @all,

i solved it. I moved the clients directory into the public directory, now it works.

This also works fine:

{% for media in user.media %}

{{ image(media.image_1, "class":"img-responsive") }}

{% endfor %}

Rgds

Stefan