Problem loading an image with codeigniter

-1

I do not upload the image and I do not know what I have wrong thanks

        foreach ($adjuntos_documents as $adjuntos){
    echo "<div class='content_documents'>";
    echo  "<div class='document2'>";
    echo    '<img  alt="Adjunto" class="imgadjunto2" src=" base_url();css/images/adjuntar.png"/>';
    echo   "<h2 class='nombredocument2'>$adjuntos->adjunto</h2>";
    echo  "<input type='text' class='fechaagregado2' value='$adjuntos->fecha_adjunto' readonly/> ";      
    echo  " </div>";
    echo  " <br>";
    echo  "</div>  "; 

}? >

    
asked by mateo nieto 12.11.2017 в 06:31
source

1 answer

1

On the line where you load the image with the <img> tag, you are not using the src attribute correctly. It is supposed to have there the route to the image that you want to be shown, probably this route comes inside your object $adjuntos_documents if the route comes complete in your object then you can do something like:

echo '<img  alt="Adjunto" class="imgadjunto2" src="' .$adjuntos->url. '"/>';

If on the other hand you need base_url() to complete your link (because the object comes partially in the object) then you can do something like this:

 echo '<img  alt="Adjunto" class="imgadjunto2" src="' .base_url($adjuntos->url). '"/>';
    
answered by 12.11.2017 в 14:16