Answer the question
In order to leave comments, you need to log in
Why doesn't TWIG see my variable?
Drupal8. I print the current URL and this code works {{ url('<current>') }}
Now I want to split the url and get part of it, and it doesn't work
{% set my_url = url('<current>')|split('/') %}{{ my_url[2] }}
Why does the twig display url('') in the first case and not in the second?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question