What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
where can i activate Twig debug mode for yves? I tried to add debug => true to \Spryker\Shared\Tw
where can i activate Twig debug mode for yves? I tried to add debug => true to \Spryker\Shared\Twig\TwigConstants::YVES_TWIG_OPTIONS, but it does not work.
Comments
-
it seems that the getTwigOptions function is not even called during an yves page load \Spryker\Yves\Twig\TwigConfig::getTwigOptions
0 -
ok still it seems to be the right place, at least \Twig\Environment::__construct is called with debug: true
0 -
but I would expect now html comments with template paths to be rendered, which is not the case
0 -
it should be sufficient to add it to your config_local.php
$config[TwigConstants::YVES_TWIG_OPTIONS] = [ 'debug' => true, ];
maybe you also need to enable debugging (not sure if it is needed for twig)
$config[ApplicationConstants::ENABLE_APPLICATION_DEBUG] = true;
0 -
thanks, but unfortunately it does not work. Not sure why. Currently I try to find the place where Twig would dump the information
0 -
How old is the project?
0 -
We had an issue in configs a while ago and this was the PR to fix it for spryker/docker-sdk based env.
0 -
@valerii.trots it should be the B2B Demo from last August
0 -
I'll try to check now.
0 -
Works.
0 -
I did not test the dump to be honest. I mean that twig outputs a html comment with each template rendered with template path (and possibly some other context). Just now I think maybe its not a twig feature, but implemented e.g. in drupal here as an extension: https://www.drupal.org/docs/theming-drupal/twig-in-drupal/locating-template-files-with-debugging
0 -
In Magento there even was (is?) a chrome plugin with a dev tools extension that provides a clickable link in the inspector tab which opens the correct template in phpstorm for editing (but a html commecnt with the path would be more then enough for the start π ).
0 -
ok, I have no idea how drupal works, but actually this code here looks like they implemented it and its not part of twig actually. But that's ok, then we can build the same thing probably in Sprykerhttps://github.com/drupal/drupal/blob/6e5fd14d91e8f5f2bf892748803871470ea8e925/core/themes/engines/twig/twig.engine#L60
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 69 Spryker News
- 899 Developer Corner
- 760 Spryker Development
- 83 Spryker Dev Environment
- 361 Spryker Releases
- 3 Oryx frontend framework
- 34 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 24 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 68 Spryker Safari Questions
- 50 Random