If I created a service is there a way to access it from twig, without creating a twig.extension?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You can set the service a twig global variable in
config.yml
, e.gAnd in your
template.html.twig
file you can invoke your service this way:See here.