Browse Source

Création du Bundle Mynetwork.

bastien 13 years ago
parent
commit
ecfd587779

+ 1 - 0
app/AppKernel.php View File

@@ -23,6 +23,7 @@ class AppKernel extends Kernel
23 23
             new Muzich\UserBundle\MuzichUserBundle(),
24 24
             new Muzich\IndexBundle\MuzichIndexBundle(),
25 25
             new Muzich\HomeBundle\MuzichHomeBundle(),
26
+            new Muzich\MynetworkBundle\MuzichMynetworkBundle(),
26 27
         );
27 28
 
28 29
         if (in_array($this->getEnvironment(), array('dev', 'test'))) {

+ 4 - 0
app/config/routing.yml View File

@@ -1,3 +1,7 @@
1
+MuzichMynetworkBundle:
2
+    resource: "@MuzichMynetworkBundle/Resources/config/routing.yml"
3
+    prefix:   /
4
+
1 5
 # Internal routing configuration to handle ESI
2 6
 #_internal:
3 7
 #   resource: "@FrameworkBundle/Resources/config/routing/internal.xml"

+ 21 - 0
src/Muzich/MynetworkBundle/Controller/MynetworkController.php View File

@@ -0,0 +1,21 @@
1
+<?php
2
+
3
+namespace Muzich\MynetworkBundle\Controller;
4
+
5
+use Muzich\CoreBundle\lib\Controller;
6
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
7
+
8
+
9
+class MynetworkController extends Controller
10
+{
11
+  
12
+  /**
13
+   * 
14
+   * @Template()
15
+   */
16
+  public function indexAction()
17
+  {
18
+    return array();
19
+  }
20
+  
21
+}

+ 29 - 0
src/Muzich/MynetworkBundle/DependencyInjection/Configuration.php View File

@@ -0,0 +1,29 @@
1
+<?php
2
+
3
+namespace Muzich\MynetworkBundle\DependencyInjection;
4
+
5
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
6
+use Symfony\Component\Config\Definition\ConfigurationInterface;
7
+
8
+/**
9
+ * This is the class that validates and merges configuration from your app/config files
10
+ *
11
+ * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
12
+ */
13
+class Configuration implements ConfigurationInterface
14
+{
15
+    /**
16
+     * {@inheritDoc}
17
+     */
18
+    public function getConfigTreeBuilder()
19
+    {
20
+        $treeBuilder = new TreeBuilder();
21
+        $rootNode = $treeBuilder->root('muzich_mynetwork');
22
+
23
+        // Here you should define the parameters that are allowed to
24
+        // configure your bundle. See the documentation linked above for
25
+        // more information on that topic.
26
+
27
+        return $treeBuilder;
28
+    }
29
+}

+ 28 - 0
src/Muzich/MynetworkBundle/DependencyInjection/MuzichMynetworkExtension.php View File

@@ -0,0 +1,28 @@
1
+<?php
2
+
3
+namespace Muzich\MynetworkBundle\DependencyInjection;
4
+
5
+use Symfony\Component\DependencyInjection\ContainerBuilder;
6
+use Symfony\Component\Config\FileLocator;
7
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
8
+use Symfony\Component\DependencyInjection\Loader;
9
+
10
+/**
11
+ * This is the class that loads and manages your bundle configuration
12
+ *
13
+ * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
14
+ */
15
+class MuzichMynetworkExtension extends Extension
16
+{
17
+    /**
18
+     * {@inheritDoc}
19
+     */
20
+    public function load(array $configs, ContainerBuilder $container)
21
+    {
22
+        $configuration = new Configuration();
23
+        $config = $this->processConfiguration($configuration, $configs);
24
+
25
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
26
+        $loader->load('services.yml');
27
+    }
28
+}

+ 9 - 0
src/Muzich/MynetworkBundle/MuzichMynetworkBundle.php View File

@@ -0,0 +1,9 @@
1
+<?php
2
+
3
+namespace Muzich\MynetworkBundle;
4
+
5
+use Symfony\Component\HttpKernel\Bundle\Bundle;
6
+
7
+class MuzichMynetworkBundle extends Bundle
8
+{
9
+}

+ 4 - 0
src/Muzich/MynetworkBundle/Resources/config/routing.yml View File

@@ -0,0 +1,4 @@
1
+
2
+mynetwork_index:
3
+  pattern:  /my-network
4
+  defaults: { _controller: MuzichMynetworkBundle:Mynetwork:index }

+ 7 - 0
src/Muzich/MynetworkBundle/Resources/config/services.yml View File

@@ -0,0 +1,7 @@
1
+parameters:
2
+#    muzich_mynetwork.example.class: Muzich\MynetworkBundle\Example
3
+
4
+services:
5
+#    muzich_mynetwork.example:
6
+#        class: %muzich_mynetwork.example.class%
7
+#        arguments: [@service_id, "plain_value", %parameter%]

+ 0 - 0
src/Muzich/MynetworkBundle/Resources/doc/index.rst View File


+ 11 - 0
src/Muzich/MynetworkBundle/Resources/translations/messages.fr.xliff View File

@@ -0,0 +1,11 @@
1
+<?xml version="1.0"?>
2
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3
+    <file source-language="en" datatype="plaintext" original="file.ext">
4
+        <body>
5
+            <trans-unit id="1">
6
+                <source>Symfony2 is great</source>
7
+                <target>J'aime Symfony2</target>
8
+            </trans-unit>
9
+        </body>
10
+    </file>
11
+</xliff>

+ 7 - 0
src/Muzich/MynetworkBundle/Resources/views/Mynetwork/index.html.twig View File

@@ -0,0 +1,7 @@
1
+{% extends "MuzichMynetworkBundle::layout.html.twig" %}
2
+
3
+{% block title %}Mon réseau{% endblock %}
4
+
5
+{% block content %}
6
+        
7
+{% endblock %}

+ 9 - 0
src/Muzich/MynetworkBundle/Resources/views/layout.html.twig View File

@@ -0,0 +1,9 @@
1
+{% extends 'MuzichCoreBundle::layout.html.twig' %}
2
+
3
+{% block css %}
4
+	<link href="{{ asset('bundles/mynetwork/css/mynetwork.css') }}" rel="stylesheet" media="screen" type="text/css" />
5
+{% endblock %}
6
+
7
+{% block main_content %}
8
+    {% block content %}{% endblock %}
9
+{% endblock %}

+ 17 - 0
src/Muzich/MynetworkBundle/Tests/Controller/DefaultControllerTest.php View File

@@ -0,0 +1,17 @@
1
+<?php
2
+
3
+namespace Muzich\MynetworkBundle\Tests\Controller;
4
+
5
+use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6
+
7
+class DefaultControllerTest extends WebTestCase
8
+{
9
+    public function testIndex()
10
+    {
11
+        $client = static::createClient();
12
+
13
+        $crawler = $client->request('GET', '/hello/Fabien');
14
+
15
+        $this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
16
+    }
17
+}

+ 7 - 0
web/bundles/mynetwork/css/mynetwork.css View File

@@ -0,0 +1,7 @@
1
+/* 
2
+    Document   : mynetwork
3
+    Created on : 27 sept. 2011, 14:41:54
4
+    Author     : bux
5
+    Description:
6
+        Purpose of the stylesheet follows.
7
+*/