From 452f3fba86c76747dfa0e7598a948e9f379ef257 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 30 Jun 2015 22:07:55 +0200 Subject: [PATCH] skeleton of the bundle --- ChillActivityBundle.php | 9 ++++++ Controller/DefaultController.php | 13 +++++++++ .../ChillActivityExtension.php | 28 ++++++++++++++++++ DependencyInjection/Configuration.php | 29 +++++++++++++++++++ Resources/config/routing.yml | 3 ++ Resources/config/services.yml | 4 +++ 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, 115 insertions(+) create mode 100644 ChillActivityBundle.php create mode 100644 Controller/DefaultController.php create mode 100644 DependencyInjection/ChillActivityExtension.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/ChillActivityBundle.php b/ChillActivityBundle.php new file mode 100644 index 000000000..36c396474 --- /dev/null +++ b/ChillActivityBundle.php @@ -0,0 +1,9 @@ +render('ChillActivityBundle:Default:index.html.twig', array('name' => $name)); + } +} diff --git a/DependencyInjection/ChillActivityExtension.php b/DependencyInjection/ChillActivityExtension.php new file mode 100644 index 000000000..9340c40f5 --- /dev/null +++ b/DependencyInjection/ChillActivityExtension.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..a177c28c4 --- /dev/null +++ b/DependencyInjection/Configuration.php @@ -0,0 +1,29 @@ +root('chill_activity'); + + // 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..6f006d159 --- /dev/null +++ b/Resources/config/routing.yml @@ -0,0 +1,3 @@ +chill_activity_homepage: + path: /hello/{name} + defaults: { _controller: ChillActivityBundle:Default:index } diff --git a/Resources/config/services.yml b/Resources/config/services.yml new file mode 100644 index 000000000..7a089a4b2 --- /dev/null +++ b/Resources/config/services.yml @@ -0,0 +1,4 @@ +services: +# chill_activity.example: +# class: Chill\ActivityBundle\Example +# 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..c653df136 --- /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); + } +}