From 17b4f221369733f80f10727e6187e40fafa71219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Sat, 26 Oct 2013 11:52:46 +0200 Subject: [PATCH] initial structure of the bundle --- CLChillPersonBundle.php | 9 ++++++ Controller/DefaultController.php | 13 +++++++++ .../CLChillPersonExtension.php | 28 ++++++++++++++++++ DependencyInjection/Configuration.php | 29 +++++++++++++++++++ Resources/config/routing.yml | 3 ++ Resources/config/services.yml | 7 +++++ Resources/doc/index.rst | 0 Resources/translations/messages.fr.xlf | 11 +++++++ Resources/views/Default/index.html.twig | 1 + Tests/Controller/DefaultControllerTest.php | 17 +++++++++++ 10 files changed, 118 insertions(+) create mode 100644 CLChillPersonBundle.php create mode 100644 Controller/DefaultController.php create mode 100644 DependencyInjection/CLChillPersonExtension.php create mode 100644 DependencyInjection/Configuration.php create mode 100644 Resources/config/routing.yml create mode 100644 Resources/config/services.yml create mode 100644 Resources/doc/index.rst create mode 100644 Resources/translations/messages.fr.xlf create mode 100644 Resources/views/Default/index.html.twig create mode 100644 Tests/Controller/DefaultControllerTest.php diff --git a/CLChillPersonBundle.php b/CLChillPersonBundle.php new file mode 100644 index 000000000..f3f47a646 --- /dev/null +++ b/CLChillPersonBundle.php @@ -0,0 +1,9 @@ +render('CLChillPersonBundle:Default:index.html.twig', array('name' => $name)); + } +} diff --git a/DependencyInjection/CLChillPersonExtension.php b/DependencyInjection/CLChillPersonExtension.php new file mode 100644 index 000000000..908c5751a --- /dev/null +++ b/DependencyInjection/CLChillPersonExtension.php @@ -0,0 +1,28 @@ +processConfiguration($configuration, $configs); + + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.yml'); + } +} diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php new file mode 100644 index 000000000..01c04eb07 --- /dev/null +++ b/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +root('cl_chill_person'); + + // Here you should define the parameters that are allowed to + // configure your bundle. See the documentation linked above for + // more information on that topic. + + return $treeBuilder; + } +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml new file mode 100644 index 000000000..39114fa73 --- /dev/null +++ b/Resources/config/routing.yml @@ -0,0 +1,3 @@ +cl_chill_person_homepage: + pattern: /hello/{name} + defaults: { _controller: CLChillPersonBundle:Default:index } diff --git a/Resources/config/services.yml b/Resources/config/services.yml new file mode 100644 index 000000000..414e3f911 --- /dev/null +++ b/Resources/config/services.yml @@ -0,0 +1,7 @@ +parameters: +# cl_chill_person.example.class: CL\Chill\PersonBundle\Example + +services: +# cl_chill_person.example: +# class: %cl_chill_person.example.class% +# arguments: [@service_id, "plain_value", %parameter%] diff --git a/Resources/doc/index.rst b/Resources/doc/index.rst new file mode 100644 index 000000000..e69de29bb diff --git a/Resources/translations/messages.fr.xlf b/Resources/translations/messages.fr.xlf new file mode 100644 index 000000000..fd59e6c16 --- /dev/null +++ b/Resources/translations/messages.fr.xlf @@ -0,0 +1,11 @@ + + + + + + Symfony2 is great + J'aime Symfony2 + + + + diff --git a/Resources/views/Default/index.html.twig b/Resources/views/Default/index.html.twig new file mode 100644 index 000000000..4ce626e9b --- /dev/null +++ b/Resources/views/Default/index.html.twig @@ -0,0 +1 @@ +Hello {{ name }}! diff --git a/Tests/Controller/DefaultControllerTest.php b/Tests/Controller/DefaultControllerTest.php new file mode 100644 index 000000000..7b4facafb --- /dev/null +++ b/Tests/Controller/DefaultControllerTest.php @@ -0,0 +1,17 @@ +request('GET', '/hello/Fabien'); + + $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0); + } +}