Created
March 23, 2011 13:47
-
-
Save caefer/883103 to your computer and use it in GitHub Desktop.
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 MyProject\MyBundle\DependencyInjection; | |
| use Symfony\Component\Config\FileLocator; | |
| use Symfony\Component\HttpKernel\DependencyInjection\Extension; | |
| use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; | |
| use Symfony\Component\DependencyInjection\ContainerBuilder; | |
| class MyExtension extends Extension | |
| { | |
| public function load(array $config, ContainerBuilder $container) | |
| { | |
| if (!$container->hasDefinition('my')) | |
| { | |
| $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); | |
| $loader->load('my.xml'); | |
| } | |
| } | |
| public function getAlias() | |
| { | |
| return 'my'; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment