I read a lot of article about the problem but it seems that there has to be no answer yet to this.
So my project directory is like :
+ uploads_dir
+ symfony_proj
- app
- bin
- src
- vendor
- web
I want to get the image inside the uploads_dir for me to use in my view page
I created twig extension that fetches the roor directory.. but it seems not to read if I put "root_dir"."../../uploads_dir".
Any suggestions ?
Here is the my twig extension part of it:
/**
* @var container
*/
protected $container;
public function __construct(ContainerInterface $container){
$this->container = $container;
}
public function bannerFilter($filename)
{
$file = $this->container->getParameter('kernel.root_dir').'../../uploads_dir'.$filename;
}