I'm exploring Drupal 8 Twig system. After I altered menu.html.twig I tried to print out menu items list, but when I load the page after appending {{ dump( items ) }} it all stucks, page is not loading, Apache process is at 15% CPU. Why is this happening? Can I somehow print out all item's content?


I'm afraid twig's dump() is a resource killer. You can follow this issue on drupal.org for more information and alternatives: Twig dump crashes site/server with out of memory.

My advice would be to use Devel's kint() function, and you might want to track Symfony's Ladybug which is under development for inclusing in Drupal 8.3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.