From c4a9ffc85d76d48d36a627dac91fb4979035b76c Mon Sep 17 00:00:00 2001 From: alexandresalome Date: Wed, 18 Apr 2012 22:01:57 +0200 Subject: [PATCH] Add snippets for Dependency Injection --- .../configuration.sublime-snippet | 31 +++++++++++++++++++ .../extension.sublime-snippet | 25 +++++++++++++++ .../services.sublime-snippet | 15 +++++++++ 3 files changed, 71 insertions(+) create mode 100644 Snippets/DependencyInjection/configuration.sublime-snippet create mode 100644 Snippets/DependencyInjection/extension.sublime-snippet create mode 100644 Snippets/DependencyInjection/services.sublime-snippet diff --git a/Snippets/DependencyInjection/configuration.sublime-snippet b/Snippets/DependencyInjection/configuration.sublime-snippet new file mode 100644 index 0000000..dd506c1 --- /dev/null +++ b/Snippets/DependencyInjection/configuration.sublime-snippet @@ -0,0 +1,31 @@ + + root('${3:bundle_name}'); + + \$rootNode + ->children() + ->scalarNode('enabled') + ->setInfo('Enable the container extension') + ->setDefault(true) + ->end() + ->end() + ; + + return \$treeBuilder; + } +} +]]> + sfdiconfiguration + source.php + Symfony2 / Dependency Injection / Configuration + diff --git a/Snippets/DependencyInjection/extension.sublime-snippet b/Snippets/DependencyInjection/extension.sublime-snippet new file mode 100644 index 0000000..205ac60 --- /dev/null +++ b/Snippets/DependencyInjection/extension.sublime-snippet @@ -0,0 +1,25 @@ + + processConfiguration(new Configuration(), \$configs); + if (false === \$config['enabled']) { + return; + } + + \$loader = new XmlFileLoader(\$container, new FileLocator(__DIR__.'/../Resources/config')); + \$loader->load('services.xml'); + } +} +]]> + sfdiextension + source.php + Symfony2 / Dependency Injection / Extension + diff --git a/Snippets/DependencyInjection/services.sublime-snippet b/Snippets/DependencyInjection/services.sublime-snippet new file mode 100644 index 0000000..fc12a16 --- /dev/null +++ b/Snippets/DependencyInjection/services.sublime-snippet @@ -0,0 +1,15 @@ + + + + + + + + + +]]> + sfdiservices + Symfony2 / Dependency Injection / Service file +