2

Theme: Basic 8.x-1.x-dev

I am trying to clear theme data after any change is done to twig files. I see that rebuildThemeData is here: https://goo.gl/EA2YL4

Currently have this within my .theme file.

\Drupal::service('theme_handler')->rebuildThemeData();

\Drupal::service('theme.registry')->reset();

Does anyone have this sort of implementation complete and working for an example? https://www.drupal.org/node/2608470

1 Answer 1

4

There are some defaults that ship with D8 in your sites/default configuration files that you can configure during development.

The application portion:

Open development.services.yml in the sites folder 
and add the following block (to disable twig cache)
        parameters:
          twig.config:
            debug : true
            auto_reload: true
            cache: false

There is more information on this Drupal.org node.

1
  • Thanks Alex, Im actually attempting to do this within the theme in order to make it simpler for other themers to just check a box in the theme settings. I will modify my question
    – arkjoseph
    Commented Jan 28, 2016 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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