i want to load pictures dynamicly from database ,
here's the table containing the image informations http://ift.tt/2o9HRRM
Controller code
public function listeproductAction()
{
$em = $this->getDoctrine()->getManager();
$img = $em->getRepository('AppBundle:image')->findAll();
return $this->render('lucky/images.html.twig', array(
'img' => $img ,
));
}
twig code
result
<div class="main-content">
<img src="/uploads/brochures/0fa58c757752ced32d04b57bb7fa0d65.png ">
</div>
the problem that asset funtion doesent find the image :(
Aucun commentaire:
Enregistrer un commentaire