I have this output from my twig template dump:
/var/www/html/vendor/twig/twig/lib/Twig/Extension/Debug.php:56:
array (size=7)
'id' => string 'views_block:about-block_1' (length=25)
'label' => string '' (length=0)
'provider' => string 'views' (length=5)
'label_display' => string '0' (length=1)
'views_label' => string '' (length=0)
'items_per_page' => string '3' (length=1)
'background' =>
array (size=1)
0 => string '136' (length=3)
So my file id (fid) is 136. I'd like to know a way to get this file's url without having to use a preprocess function.
Can this be done? Would I have to do a custom twig function to achieve this? If so where would I add the code to extend twig?
ex:
$twig = new Twig_Environment($loader);
$function = new Twig_SimpleFunction('function_name', function () {
// ...
});
$twig->addFunction($function);