Created
September 7, 2016 21:02
-
-
Save mirie/d5c5566522b1353e949b25f86f94c82b to your computer and use it in GitHub Desktop.
Example: D8 - Remove a service definition. Put in src directory of a module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\myModule; | |
use Drupal\Core\DependencyInjection\ContainerBuilder; | |
use Drupal\Core\DependencyInjection\ServiceProviderBase; | |
/** | |
* Removes the internationalization service definitions from twig_extension. | |
*/ | |
class myModuleServiceProvider extends ServiceProviderBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function alter(ContainerBuilder $container) { | |
$container->removeDefinition('twig_extensions.twig.i18n'); | |
$container->removeDefinition('twig_extensions.twig.intl'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment