Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ValeriiVasyliev/af852170c095dc9887f81af270518d00 to your computer and use it in GitHub Desktop.
Save ValeriiVasyliev/af852170c095dc9887f81af270518d00 to your computer and use it in GitHub Desktop.
Drupal 8. Set programmatically theme default
<?php
\Drupal::service('theme_installer')->install('my_custom_theme');
\Drupal::configFactory()
->getEditable('system.theme')
->set('default', 'my_custom_theme')
->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment