I am new to Symfony & trying to list images in sonata admin bundle. But i am bit confuse how to get an object in twig file so that i can get my exact path for image source.
here is my code
protected function configureListFields(ListMapper $listMapper)
{
// $image = $this->getSubject();
$listMapper
->addIdentifier('caption')
->add('image','string', array('template' => 'swaamImageUploaderBundle:Admin:list_image.html.twig'))
;
}
and here is my list_image.html.twig file
{% extends 'SonataAdminBundle:CRUD:base_list_field.html.twig' %}
{% block field%}
<img src="{{ 'uploads/images/822b23a922f43bb664cb58ca57de6cccccc962e5.jpeg'}}">
{#<img src="{{ asset(image.getthumbWebPath) }}">#}
{% endblock %}
in my image source tag i have given a hard code path for my testing. but don't know how to get path from db.
plus, when i write only ->add('image') in controller i get my exact path from db displayed in back end.
I have an entity image.
any one who can help me ?