in controller:
$this->getRequest()->getUriForPath('/uploads/myimage.jpg');
in twig:
{{ app.request.uriForPath('/uploads/myimage.jpg') }}
or
{{ asset('/uploads/myimage.jpg')}}
评论
发表评论