06.
Twig
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
14 Comments
When the template it's not found: Alt + Enter -> Create template ;)
Cheating! I'm just getting - I *love* this shortcut - I think it's still kinda new to PhpStorm?
If you're reading this and wondering what magic we're talking about, there's an example in this video: http://knpuniversity.com/sc... at about 1:45.
But that's way later in the series :) - thanks for posting this little easter egg here Sergiu P.!
Tip for when autocomplete of variables does'nt work :
Insert a comment like :
{# @var Varname \AppBundle\Entity\EntityName #}
Nice tip! I do this in PHP, but I didn't know it worked with Twig!
if auto-complete is not working in twig.
1) Click left menu, make sure mark 'src directory' as sources root
2) Go to menu. File -> Invalidate Caches / Restart
Hey Yan,
Wow, I didn't think marking src/ as a source root is important for Twig autocomplete. Hm, probably cache Invalidating did the trick? Anyway, thanks for sharing this info!
Cheers!
Hello there!!!
How can i use the Twig Extensions ??
I did see in official website the Twig Extensions give access to an filter called: localizedcurrency('BRL')
That returns the Currency with R$ 0.000,00
How can i activate in SF3??
Best Regards.
Yea, the Twig extensions are awesome! You just need to register the class from the Twig extension library as a service and tag it with twig.extension yourself :).
About this... i did not got it... did try but failed... :(
Do you remember what the issue was? The process will be similar to this: http://knpuniversity.com/sc... - the difference is that you won't need to create the PHP extension class. You will simply register the existing class from the Twig-extension library as a service.
I hope that helps!
Nothing
Hey Xeyos,
I see you edited your message. Have you solved your problem?
Cheers!
Yes, thank you.
Not at all! I'm glad you had got it working before I replied to you ;)
Cheers!
"Houston: no signs of life"
Start the conversation!