Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

web bundle creation, readme.md and basic config, first real app commit

  • Loading branch information...
commit d1bec956b60d00b239e759b7bd4005d405eded3a 1 parent d8559c4
Ricard Clau ricardclau authored
Showing with 348 additions and 932 deletions.
  1. +3 −1 .gitignore
  2. +148 −0 README-SF2.md
  3. +67 −107 README.md
  4. +1 −1  app/AppKernel.php
  5. +1 −1  app/config/config.yml
  6. +19 −0 app/config/parameters.ini
  7. +15 −0 app/config/parameters.yml.dist
  8. +5 −0 app/config/routing.yml
  9. +0 −13 app/config/routing_dev.yml
  10. +0 −9 src/Acme/DemoBundle/AcmeDemoBundle.php
  11. +0 −57 src/Acme/DemoBundle/Controller/DemoController.php
  12. +0 −69 src/Acme/DemoBundle/Controller/SecuredController.php
  13. +0 −13 src/Acme/DemoBundle/Controller/WelcomeController.php
  14. +0 −25 src/Acme/DemoBundle/ControllerListener.php
  15. +0 −22 src/Acme/DemoBundle/DependencyInjection/AcmeDemoExtension.php
  16. +0 −20 src/Acme/DemoBundle/Form/ContactType.php
  17. +0 −18 src/Acme/DemoBundle/Resources/config/services.xml
  18. +0 −293 src/Acme/DemoBundle/Resources/public/css/demo.css
  19. BIN  src/Acme/DemoBundle/Resources/public/images/blue-arrow.png
  20. BIN  src/Acme/DemoBundle/Resources/public/images/field-background.gif
  21. BIN  src/Acme/DemoBundle/Resources/public/images/logo.gif
  22. BIN  src/Acme/DemoBundle/Resources/public/images/search.png
  23. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-configure.gif
  24. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-demo.gif
  25. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-quick-tour.gif
  26. +0 −15 src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig
  27. +0 −9 src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig
  28. +0 −14 src/Acme/DemoBundle/Resources/views/Demo/index.html.twig
  29. +0 −11 src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig
  30. +0 −9 src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig
  31. +0 −6 src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig
  32. +0 −29 src/Acme/DemoBundle/Resources/views/Secured/login.html.twig
  33. +0 −63 src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig
  34. +0 −49 src/Acme/DemoBundle/Resources/views/layout.html.twig
  35. +0 −74 src/Acme/DemoBundle/Twig/Extension/DemoExtension.php
  36. +18 −0 src/SFBCN/WebsiteBundle/Controller/DefaultController.php
  37. +29 −0 src/SFBCN/WebsiteBundle/DependencyInjection/Configuration.php
  38. +28 −0 src/SFBCN/WebsiteBundle/DependencyInjection/SFBCNWebsiteExtension.php
  39. 0  src/SFBCN/WebsiteBundle/Resources/config/services.yml
  40. 0  src/SFBCN/WebsiteBundle/Resources/doc/index.rst
  41. 0  src/SFBCN/WebsiteBundle/Resources/public/css/01-reset.css
  42. 0  src/SFBCN/WebsiteBundle/Resources/translations/messages.es_ES.yml
  43. +1 −0  src/SFBCN/WebsiteBundle/Resources/views/Default/index.html.twig
  44. +9 −0 src/SFBCN/WebsiteBundle/SFBCNWebsiteBundle.php
  45. +4 −4 ...ts/Controller/DemoControllerTest.php → SFBCN/WebsiteBundle/Tests/Controller/DefaultControllerTest.php}
4 .gitignore
View
@@ -3,4 +3,6 @@
/app/cache/*
/app/logs/*
/vendor/
-/app/config/parameters.ini
+/app/config/parameters.yml
+/.idea
+/nbproject
148 README-SF2.md
View
@@ -0,0 +1,148 @@
+Symfony Standard Edition
+========================
+
+Welcome to the Symfony Standard Edition - a fully-functional Symfony2
+application that you can use as the skeleton for your new app. If you want
+to learn more about the features included, see the "What's Inside?" section.
+
+This document contains information on how to download and start using Symfony.
+For a more detailed explanation, see the
+[Installation chapter](http://symfony.com/doc/current/book/installation.html)
+of the Symfony Documentation.
+
+1) Download the Standard Edition
+--------------------------------
+
+If you've already downloaded the standard edition, and unpacked it somewhere
+within your web root directory, then move on to the "Installation" section.
+
+To download the standard edition, you have two options:
+
+### Download an archive file (*recommended*)
+
+The easiest way to get started is to download an archive of the standard edition
+(http://symfony.com/download). Unpack it somewhere under your web server root
+directory and you're done. The web root is wherever your web server (e.g. Apache)
+looks when you access `http://localhost` in a browser.
+
+### Clone the git Repository
+
+We highly recommend that you download the packaged version of this distribution.
+But if you still want to use Git, you are on your own.
+
+Run the following commands:
+
+ git clone http://github.com/symfony/symfony-standard.git
+ cd symfony-standard
+ rm -rf .git
+
+2) Installation
+---------------
+
+Once you've downloaded the standard edition, installation is easy, and basically
+involves making sure your system is ready for Symfony.
+
+### a) Check your System Configuration
+
+Before you begin, make sure that your local system is properly configured
+for Symfony. To do this, execute the following:
+
+ php app/check.php
+
+If you get any warnings or recommendations, fix these now before moving on.
+
+### b) Install the Vendor Libraries
+
+If you downloaded the archive "without vendors" or installed via git, then
+you need to download all of the necessary vendor libraries. If you're not
+sure if you need to do this, check to see if you have a ``vendor/`` directory.
+If you don't, or if that directory is empty, run the following:
+
+ php bin/vendors install
+
+Note that you **must** have git installed and be able to execute the `git`
+command to execute this script. If you don't have git available, either install
+it or download Symfony with the vendor libraries already included.
+
+### c) Access the Application via the Browser
+
+Congratulations! You're now ready to use Symfony. If you've unzipped Symfony
+in the web root of your computer, then you should be able to access the
+web version of the Symfony requirements check via:
+
+ http://localhost/Symfony/web/config.php
+
+If everything looks good, click the "Bypass configuration and go to the Welcome page"
+link to load up your first Symfony page.
+
+You can also use a web-based configurator by clicking on the "Configure your
+Symfony Application online" link of the ``config.php`` page.
+
+To see a real-live Symfony page in action, access the following page:
+
+ web/app_dev.php/demo/hello/Fabien
+
+3) Learn about Symfony!
+-----------------------
+
+This distribution is meant to be the starting point for your application,
+but it also contains some sample code that you can learn from and play with.
+
+A great way to start learning Symfony is via the [Quick Tour](http://symfony.com/doc/current/quick_tour/the_big_picture.html),
+which will take you through all the basic features of Symfony2 and the test
+pages that are available in the standard edition.
+
+Once you're feeling good, you can move onto reading the official
+[Symfony2 book](http://symfony.com/doc/current/).
+
+Using this Edition as the Base of your Application
+--------------------------------------------------
+
+Since the standard edition is fully-configured and comes with some examples,
+you'll need to make a few changes before using it to build your application.
+
+The distribution is configured with the following defaults:
+
+* Twig is the only configured template engine;
+* Doctrine ORM/DBAL is configured;
+* Swiftmailer is configured;
+* Annotations for everything are enabled.
+
+A default bundle, ``AcmeDemoBundle``, shows you Symfony2 in action. After
+playing with it, you can remove it by following these steps:
+
+* delete the ``src/Acme`` directory;
+* remove the routing entries referencing AcmeBundle in ``app/config/routing_dev.yml``;
+* remove the AcmeBundle from the registered bundles in ``app/AppKernel.php``;
+
+
+What's inside?
+---------------
+The Symfony Standard Edition comes pre-configured with the following bundles:
+
+* **FrameworkBundle** - The core Symfony framework bundle
+* **SensioFrameworkExtraBundle** - Adds several enhancements, including template
+ and routing annotation capability ([documentation](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html))
+* **DoctrineBundle** - Adds support for the Doctrine ORM
+ ([documentation](http://symfony.com/doc/current/book/doctrine.html))
+* **TwigBundle** - Adds support for the Twig templating engine
+ ([documentation](http://symfony.com/doc/current/book/templating.html))
+* **SecurityBundle** - Adds security by integrating Symfony's security component
+ ([documentation](http://symfony.com/doc/current/book/security.html))
+* **SwiftmailerBundle** - Adds support for Swiftmailer, a library for sending emails
+ ([documentation](http://symfony.com/doc/2.0/cookbook/email.html))
+* **MonologBundle** - Adds support for Monolog, a logging library
+ ([documentation](http://symfony.com/doc/2.0/cookbook/logging/monolog.html))
+* **AsseticBundle** - Adds support for Assetic, an asset processing library
+ ([documentation](http://symfony.com/doc/2.0/cookbook/assetic/asset_management.html))
+* **JMSSecurityExtraBundle** - Allows security to be added via annotations
+ ([documentation](http://symfony.com/doc/current/bundles/JMSSecurityExtraBundle/index.html))
+* **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and
+ the web debug toolbar
+* **SensioDistributionBundle** (in dev/test env) - Adds functionality for configuring
+ and working with Symfony distributions
+* **SensioGeneratorBundle** (in dev/test env) - Adds code generation capabilities
+ ([documentation](http://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html))
+* **AcmeDemoBundle** (in dev/test env) - A demo bundle with some example code
+
+Enjoy!
174 README.md
View
@@ -1,148 +1,108 @@
-Symfony Standard Edition
-========================
+Symfony Barcelona
+==============
-Welcome to the Symfony Standard Edition - a fully-functional Symfony2
-application that you can use as the skeleton for your new app. If you want
-to learn more about the features included, see the "What's Inside?" section.
+1) Instalación
+--------------------------------
-This document contains information on how to download and start using Symfony.
-For a more detailed explanation, see the
-[Installation chapter](http://symfony.com/doc/current/book/installation.html)
-of the Symfony Documentation.
+### Clonar el repositorio git
-1) Download the Standard Edition
---------------------------------
+ git clone git@github.com:symfony-barcelona/symfony-barcelona.git
+ cd symfony-barcelona
+
+### Crear el archivo parameters.yml (sustituto de parameters.ini en las próximas versiones)
+
+ cp app/config/parameters.yml.dist app/config/parameters.yml
-If you've already downloaded the standard edition, and unpacked it somewhere
-within your web root directory, then move on to the "Installation" section.
+En el repositorio está commiteado el archivo parameters.ini para que no falle el bundle SensioDistributionBundle, usado por ejemplo para regenerar el bootstrap.php.cache en actualizaciones de Symfony2
-To download the standard edition, you have two options:
+### Configurar la base de datos, los datos de correo, el locale y el token CSRF en el parameters.yml
-### Download an archive file (*recommended*)
+ database_driver = pdo_mysql
+ database_host = localhost
+ database_port = 3306
+ database_name = symfony-barcelona
+ database_user = root
+ database_password = ~
-The easiest way to get started is to download an archive of the standard edition
-(http://symfony.com/download). Unpack it somewhere under your web server root
-directory and you're done. The web root is wherever your web server (e.g. Apache)
-looks when you access `http://localhost` in a browser.
+ mailer_transport: smtp
+ mailer_host: localhost
+ mailer_user: ~
+ mailer_password: ~
-### Clone the git Repository
+ locale: es_ES
+ secret: "Symf0nyBCN-T0k3n!"
-We highly recommend that you download the packaged version of this distribution.
-But if you still want to use Git, you are on your own.
+### Actualizar vendors y deployar los assets de los bundles que haya en los vendors
-Run the following commands:
+ php bin/vendors install
- git clone http://github.com/symfony/symfony-standard.git
- cd symfony-standard
- rm -rf .git
+### Crear base de datos
-2) Installation
----------------
+ mysql -u [usuario] -p [password] -e "create database symfony-barcelona CHARACTER SET utf8 COLLATE utf8_general_ci"
-Once you've downloaded the standard edition, installation is easy, and basically
-involves making sure your system is ready for Symfony.
+o
-### a) Check your System Configuration
+ php app/console doctrine:database:create
-Before you begin, make sure that your local system is properly configured
-for Symfony. To do this, execute the following:
+### Generar el modelo de datos
- php app/check.php
+La primera vez
-If you get any warnings or recommendations, fix these now before moving on.
+ php app/console doctrine:schema:create
-### b) Install the Vendor Libraries
+y para actualizar
-If you downloaded the archive "without vendors" or installed via git, then
-you need to download all of the necessary vendor libraries. If you're not
-sure if you need to do this, check to see if you have a ``vendor/`` directory.
-If you don't, or if that directory is empty, run the following:
+ php app/console doctrine:schema:update --force
- php bin/vendors install
+### Cargar los datos de prueba
-Note that you **must** have git installed and be able to execute the `git`
-command to execute this script. If you don't have git available, either install
-it or download Symfony with the vendor libraries already included.
+ php app/console doctrine:fixtures:load
-### c) Access the Application via the Browser
+### Configurar Apache (Ubuntu)
-Congratulations! You're now ready to use Symfony. If you've unzipped Symfony
-in the web root of your computer, then you should be able to access the
-web version of the Symfony requirements check via:
+Editar el archivo hosts:
- http://localhost/Symfony/web/config.php
+ $ sudo gedit /etc/hosts
-If everything looks good, click the "Bypass configuration and go to the Welcome page"
-link to load up your first Symfony page.
+y añadir la línea siguiente:
-You can also use a web-based configurator by clicking on the "Configure your
-Symfony Application online" link of the ``config.php`` page.
+ 127.0.0.1 www.symfony-barcelona.dev
-To see a real-live Symfony page in action, access the following page:
+Configuramos un VirtualHost para el nuevo dominio, editando el archivo (nuevo) www.symfony-barcelona.dev del directorio sites-available de apache2:
- web/app_dev.php/demo/hello/Fabien
+ $ sudo gedit /etc/apache2/sites-available/www.symfony-barcelona.dev
-3) Learn about Symfony!
------------------------
+con el siguiente contenido:
-This distribution is meant to be the starting point for your application,
-but it also contains some sample code that you can learn from and play with.
+ <VirtualHost *:80>
+ ServerName www.symfony-barcelona.dev
+ DocumentRoot /home/miusuario/www/symfony-barcelona/web
+ DirectoryIndex app.php
-A great way to start learning Symfony is via the [Quick Tour](http://symfony.com/doc/current/quick_tour/the_big_picture.html),
-which will take you through all the basic features of Symfony2 and the test
-pages that are available in the standard edition.
+ <Directory "/home/miusuario/www/symfony-barcelona/web">
+ AllowOverride All
+ Allow from All
+ </Directory>
+ </VirtualHost>
-Once you're feeling good, you can move onto reading the official
-[Symfony2 book](http://symfony.com/doc/current/).
+Habilitamos el nuevo VirtualHost:
-Using this Edition as the Base of your Application
---------------------------------------------------
+ $ sudo a2ensite www.symfony-barcelona.dev
-Since the standard edition is fully-configured and comes with some examples,
-you'll need to make a few changes before using it to build your application.
+Reiniciamos apache:
-The distribution is configured with the following defaults:
+ $ sudo /etc/init.d/apache2 restart
-* Twig is the only configured template engine;
-* Doctrine ORM/DBAL is configured;
-* Swiftmailer is configured;
-* Annotations for everything are enabled.
+### Configurar los permisos de app/cache y app/logs (Ubuntu)
-A default bundle, ``AcmeDemoBundle``, shows you Symfony2 in action. After
-playing with it, you can remove it by following these steps:
+Para los permisos mucha gente recomienda instalar el paquete ACL.
+Sin embargo, nuestra recomendación es modificar el usuario con el cual se ejecuta Apache para que coincida con nuestro usuario del ordenador donde estemos trabajando.
-* delete the ``src/Acme`` directory;
-* remove the routing entries referencing AcmeBundle in ``app/config/routing_dev.yml``;
-* remove the AcmeBundle from the registered bundles in ``app/AppKernel.php``;
+Para ello, hay que editar el archivo envvars de Apache
+ $ sudo vim /etc/apache/envvars
-What's inside?
----------------
-The Symfony Standard Edition comes pre-configured with the following bundles:
-
-* **FrameworkBundle** - The core Symfony framework bundle
-* **SensioFrameworkExtraBundle** - Adds several enhancements, including template
- and routing annotation capability ([documentation](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html))
-* **DoctrineBundle** - Adds support for the Doctrine ORM
- ([documentation](http://symfony.com/doc/current/book/doctrine.html))
-* **TwigBundle** - Adds support for the Twig templating engine
- ([documentation](http://symfony.com/doc/current/book/templating.html))
-* **SecurityBundle** - Adds security by integrating Symfony's security component
- ([documentation](http://symfony.com/doc/current/book/security.html))
-* **SwiftmailerBundle** - Adds support for Swiftmailer, a library for sending emails
- ([documentation](http://symfony.com/doc/2.0/cookbook/email.html))
-* **MonologBundle** - Adds support for Monolog, a logging library
- ([documentation](http://symfony.com/doc/2.0/cookbook/logging/monolog.html))
-* **AsseticBundle** - Adds support for Assetic, an asset processing library
- ([documentation](http://symfony.com/doc/2.0/cookbook/assetic/asset_management.html))
-* **JMSSecurityExtraBundle** - Allows security to be added via annotations
- ([documentation](http://symfony.com/doc/current/bundles/JMSSecurityExtraBundle/index.html))
-* **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and
- the web debug toolbar
-* **SensioDistributionBundle** (in dev/test env) - Adds functionality for configuring
- and working with Symfony distributions
-* **SensioGeneratorBundle** (in dev/test env) - Adds code generation capabilities
- ([documentation](http://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html))
-* **AcmeDemoBundle** (in dev/test env) - A demo bundle with some example code
+Y modificar las líneas siguientes reemplazando www-data por nuestro usuario
-Enjoy!
+ $ export APACHE_RUN_USER=[usuario]
+ $ export APACHE_RUN_GROUP=[usuario]
2  app/AppKernel.php
View
@@ -17,10 +17,10 @@ public function registerBundles()
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
+ new SFBCN\WebsiteBundle\SFBCNWebsiteBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
- $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
2  app/config/config.yml
View
@@ -1,5 +1,5 @@
imports:
- - { resource: parameters.ini }
+ - { resource: parameters.yml }
- { resource: security.yml }
framework:
19 app/config/parameters.ini
View
@@ -0,0 +1,19 @@
+; These parameters can be imported into other config files
+; by enclosing the key with % (like %database_user%)
+; Comments start with ';', as in php.ini
+[parameters]
+ database_driver = pdo_mysql
+ database_host = localhost
+ database_port =
+ database_name = symfony
+ database_user = root
+ database_password =
+
+ mailer_transport = smtp
+ mailer_host = localhost
+ mailer_user =
+ mailer_password =
+
+ locale = en
+
+ secret = ThisTokenIsNotSoSecretChangeIt
15 app/config/parameters.yml.dist
View
@@ -0,0 +1,15 @@
+parameters:
+ database_driver: pdo_mysql
+ database_host: localhost
+ database_port: 3306
+ database_name: symfony-barcelona
+ database_user: root
+ database_password: ~
+
+ mailer_transport: smtp
+ mailer_host: localhost
+ mailer_user: ~
+ mailer_password: ~
+
+ locale: es_ES
+ secret: "Symf0nyBCN-T0k3n!"
5 app/config/routing.yml
View
@@ -1,3 +1,8 @@
+SFBCNWebsiteBundle:
+ resource: "@SFBCNWebsiteBundle/Controller/"
+ type: annotation
+ prefix: /
+
# Internal routing configuration to handle ESI
#_internal:
# resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
13 app/config/routing_dev.yml
View
@@ -1,16 +1,3 @@
-_welcome:
- pattern: /
- defaults: { _controller: AcmeDemoBundle:Welcome:index }
-
-_demo_secured:
- resource: "@AcmeDemoBundle/Controller/SecuredController.php"
- type: annotation
-
-_demo:
- resource: "@AcmeDemoBundle/Controller/DemoController.php"
- type: annotation
- prefix: /demo
-
_assetic:
resource: .
type: assetic
9 src/Acme/DemoBundle/AcmeDemoBundle.php
View
@@ -1,9 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle;
-
-use Symfony\Component\HttpKernel\Bundle\Bundle;
-
-class AcmeDemoBundle extends Bundle
-{
-}
57 src/Acme/DemoBundle/Controller/DemoController.php
View
@@ -1,57 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Symfony\Component\HttpFoundation\RedirectResponse;
-use Acme\DemoBundle\Form\ContactType;
-
-// these import the "@Route" and "@Template" annotations
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
-
-class DemoController extends Controller
-{
- /**
- * @Route("/", name="_demo")
- * @Template()
- */
- public function indexAction()
- {
- return array();
- }
-
- /**
- * @Route("/hello/{name}", name="_demo_hello")
- * @Template()
- */
- public function helloAction($name)
- {
- return array('name' => $name);
- }
-
- /**
- * @Route("/contact", name="_demo_contact")
- * @Template()
- */
- public function contactAction()
- {
- $form = $this->get('form.factory')->create(new ContactType());
-
- $request = $this->get('request');
- if ('POST' == $request->getMethod()) {
- $form->bindRequest($request);
- if ($form->isValid()) {
- $mailer = $this->get('mailer');
- // .. setup a message and send it
- // http://symfony.com/doc/current/cookbook/email.html
-
- $this->get('session')->setFlash('notice', 'Message sent!');
-
- return new RedirectResponse($this->generateUrl('_demo'));
- }
- }
-
- return array('form' => $form->createView());
- }
-}
69 src/Acme/DemoBundle/Controller/SecuredController.php
View
@@ -1,69 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Symfony\Component\Security\Core\SecurityContext;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
-use JMS\SecurityExtraBundle\Annotation\Secure;
-
-/**
- * @Route("/demo/secured")
- */
-class SecuredController extends Controller
-{
- /**
- * @Route("/login", name="_demo_login")
- * @Template()
- */
- public function loginAction()
- {
- if ($this->get('request')->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
- $error = $this->get('request')->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
- } else {
- $error = $this->get('request')->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
- }
-
- return array(
- 'last_username' => $this->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
- 'error' => $error,
- );
- }
-
- /**
- * @Route("/login_check", name="_security_check")
- */
- public function securityCheckAction()
- {
- // The security layer will intercept this request
- }
-
- /**
- * @Route("/logout", name="_demo_logout")
- */
- public function logoutAction()
- {
- // The security layer will intercept this request
- }
-
- /**
- * @Route("/hello", defaults={"name"="World"}),
- * @Route("/hello/{name}", name="_demo_secured_hello")
- * @Template()
- */
- public function helloAction($name)
- {
- return array('name' => $name);
- }
-
- /**
- * @Route("/hello/admin/{name}", name="_demo_secured_hello_admin")
- * @Secure(roles="ROLE_ADMIN")
- * @Template()
- */
- public function helloadminAction($name)
- {
- return array('name' => $name);
- }
-}
13 src/Acme/DemoBundle/Controller/WelcomeController.php
View
@@ -1,13 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-
-class WelcomeController extends Controller
-{
- public function indexAction()
- {
- return $this->render('AcmeDemoBundle:Welcome:index.html.twig');
- }
-}
25 src/Acme/DemoBundle/ControllerListener.php
View
@@ -1,25 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle;
-
-use Symfony\Component\EventDispatcher\Event;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
-use Acme\DemoBundle\Twig\Extension\DemoExtension;
-
-class ControllerListener
-{
- protected $extension;
-
- public function __construct(DemoExtension $extension)
- {
- $this->extension = $extension;
- }
-
- public function onKernelController(FilterControllerEvent $event)
- {
- if (HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) {
- $this->extension->setController($event->getController());
- }
- }
-}
22 src/Acme/DemoBundle/DependencyInjection/AcmeDemoExtension.php
View
@@ -1,22 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\DependencyInjection;
-
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
-use Symfony\Component\HttpKernel\DependencyInjection\Extension;
-use Symfony\Component\Config\FileLocator;
-
-class AcmeDemoExtension extends Extension
-{
- public function load(array $configs, ContainerBuilder $container)
- {
- $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
- $loader->load('services.xml');
- }
-
- public function getAlias()
- {
- return 'acme_demo';
- }
-}
20 src/Acme/DemoBundle/Form/ContactType.php
View
@@ -1,20 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\Form;
-
-use Symfony\Component\Form\AbstractType;
-use Symfony\Component\Form\FormBuilder;
-
-class ContactType extends AbstractType
-{
- public function buildForm(FormBuilder $builder, array $options)
- {
- $builder->add('email', 'email');
- $builder->add('message', 'textarea');
- }
-
- public function getName()
- {
- return 'contact';
- }
-}
18 src/Acme/DemoBundle/Resources/config/services.xml
View
@@ -1,18 +0,0 @@
-<?xml version="1.0" ?>
-
-<container xmlns="http://symfony.com/schema/dic/services"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
-
- <services>
- <service id="twig.extension.acme.demo" class="Acme\DemoBundle\Twig\Extension\DemoExtension" public="false">
- <tag name="twig.extension" />
- <argument type="service" id="twig.loader" />
- </service>
-
- <service id="acme.demo.listener" class="Acme\DemoBundle\ControllerListener">
- <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController" />
- <argument type="service" id="twig.extension.acme.demo" />
- </service>
- </services>
-</container>
293 src/Acme/DemoBundle/Resources/public/css/demo.css
View
@@ -1,293 +0,0 @@
-/*
-Copyright (c) 2010, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.com/yui/license.html
-version: 2.8.2r1
-
-Reset
-*/
-
-html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}
-
-html, body
-{
- background-color: #EFEFEF;
-}
-
-body
-{
- font-size: 14px;
- font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
- color: #313131;
-}
-
-a
-{
- color: #08C;
- text-decoration: none;
-}
-
-a:hover
-{
- text-decoration: underline;
-}
-
-strong
-{
- font-weight: bold;
-}
-
-em
-{
- font-style: italic;
-}
-
-h1, h2, h3
-{
- font-family: Georgia, "Times New Roman", Times, serif;
- color: #404040;
-}
-
-h1
-{
- font-size: 45px;
- padding-bottom: 30px;
-}
-
-h2
-{
- font-weight: bold;
- color: #FFFFFF;
- /* Font is duplicated of body (sans-serif) */
- font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
-
- margin-bottom: 10px;
- background-color: #aacd4e;
- padding: 2px 4px;
- display: inline-block;
- text-transform: uppercase;
-
-}
-
-p
-{
- line-height: 20px;
- padding-bottom: 20px;
-}
-
-ul#demo-list a
-{
- background: url(../images/blue-arrow.png) no-repeat right 6px;
- padding-right: 10px;
-}
-
-ul, ol
-{
- padding-left: 20px;
-}
-
-li
-{
- padding-bottom: 18px;
-}
-
-ol li
-{
- list-style-type: decimal;
-}
-
-ul li
-{
- list-style-type: none;
-}
-
-#symfony-header
-{
- position: relative;
- padding: 30px 30px 20px 30px;
-}
-
-#symfony-wrapper
-{
- width: 970px;
- margin: 0 auto;
-}
-
-.symfony-content
-{
- background-color: white;
- border: 1px solid #DFDFDF;
- padding: 50px;
- -moz-border-radius: 16px;
- -webkit-border-radius: 16px;
- border-radius: 16px;
- margin-bottom: 20px;
- word-wrap: break-word;
-}
-
-#symfony-search
-{
- position: absolute;
- top: 50px;
- right: 30px;
-}
-
-#symfony-search input[type="search"]
-{
- -webkit-appearance: textfield;
-}
-
-#symfony-search-field
-{
- width: 190px;
-}
-
-#symfony-search label
-{
- display: block;
- float: left;
- width: 20px;
- height: 25px;
- background: url(../images/search.png) no-repeat left 5px;
-}
-
-#symfony-search label span
-{
- display: none;
-}
-
-input[type=text], input[type=password]
-{
- border: 1px solid #DADADA;
- background: white url(../images/field-background.gif) repeat-x left top;
- padding: 5px 6px;
- color: #565656;
- font-family: 'Lucida Sans Unicode', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
-}
-
-.symfony-button-grey,
-.symfony-button-green
-{
- font-size: 0.85em;
- font-weight: bold;
-
- cursor: pointer;
-
- display: inline-block;
- outline: none;
-
- text-align: center;
- text-transform: uppercase;
-
- padding: 3px 10px;
-
- text-shadow: 0 1px 1px rgba(0,0,0,.3);
-
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-
-.symfony-button-grey
-{
- color: #868686;
- font-weight: normal;
-
- padding: 5px 10px;
- border: solid 1px #d7d7d7;
- background: #ffffff;
- background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#d7d7d7));
- background: -moz-linear-gradient(top, #ffffff, #d7d7d7);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#d7d7d7');
-}
-
-.symfony-button-green
-{
- padding: 5px 12px;
-
- color: white;
-
- border: solid 1px #a7da39;
- background: #a7da39;
- background: -webkit-gradient(linear, left top, left bottom, from(#a7da39), to(#6a9211));
- background: -moz-linear-gradient(top, #a7da39, #6a9211);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#a7da39', endColorstr='#6a9211');
-}
-
-.symfony-blocks-welcome
-{
- overflow: hidden;
-}
-
-.symfony-blocks-welcome > div
-{
- background-color: whitesmoke;
- float: left;
- width: 240px;
- margin-right: 14px;
- text-align: center;
- padding: 26px 20px;
-}
-
-.symfony-blocks-welcome > div.block-demo
-{
- margin-right: 0;
-}
-
-.symfony-blocks-welcome .illustration
-{
- padding-bottom: 20px;
-}
-
-.symfony-blocks-help
-{
- overflow: hidden;
-}
-
-.symfony-blocks-help
-{
- margin-top: 30px;
- padding: 18px;
- border: 1px solid #E6E6E6;
-}
-
-.symfony-blocks-help > div
-{
- width: 254px;
- float: left;
-}
-
-.flash-message
-{
- padding: 10px;
- margin: 5px;
- margin-top: 15px;
- background-color: #ffe;
-}
-
-.error
-{
- color: red;
-}
-
-#login label, #contact_form label
-{
- display: block;
- float: left;
- width: 90px;
-}
-
-ul#menu
-{
- float: right;
- margin-bottom: 20px;
- padding-left: 0;
-}
-
-#menu li
-{
- padding-left: 0;
- margin-right: 10px;
- display: inline;
-}
BIN  src/Acme/DemoBundle/Resources/public/images/blue-arrow.png
View
Deleted file not rendered
BIN  src/Acme/DemoBundle/Resources/public/images/field-background.gif
View
Deleted file not rendered
BIN  src/Acme/DemoBundle/Resources/public/images/logo.gif
View
Deleted file not rendered
BIN  src/Acme/DemoBundle/Resources/public/images/search.png
View
Deleted file not rendered
BIN  src/Acme/DemoBundle/Resources/public/images/welcome-configure.gif
View
Deleted file not rendered
BIN  src/Acme/DemoBundle/Resources/public/images/welcome-demo.gif
View
Deleted file not rendered
BIN  src/Acme/DemoBundle/Resources/public/images/welcome-quick-tour.gif
View
Deleted file not rendered
15 src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig
View
@@ -1,15 +0,0 @@
-{% extends "AcmeDemoBundle::layout.html.twig" %}
-
-{% block title "Symfony - Contact form" %}
-
-{% block content %}
- <form action="{{ path('_demo_contact') }}" method="POST" id="contact_form">
- {{ form_errors(form) }}
-
- {{ form_row(form.email) }}
- {{ form_row(form.message) }}
-
- {{ form_rest(form) }}
- <input type="submit" value="Send" class="symfony-button-grey" />
- </form>
-{% endblock %}
9 src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig
View
@@ -1,9 +0,0 @@
-{% extends "AcmeDemoBundle::layout.html.twig" %}
-
-{% block title "Hello " ~ name %}
-
-{% block content %}
- <h1>Hello {{ name }}!</h1>
-{% endblock %}
-
-{% set code = code(_self) %}
14 src/Acme/DemoBundle/Resources/views/Demo/index.html.twig
View
@@ -1,14 +0,0 @@
-{% extends "AcmeDemoBundle::layout.html.twig" %}
-
-{% block title "Symfony - Demos" %}
-
-{% block content_header '' %}
-
-{% block content %}
- <h1>Available demos</h1>
- <ul id="demo-list">
- <li><a href="{{ path('_demo_hello', {'name': 'World'}) }}">Hello World</a></li>
- <li><a href="{{ path('_demo_secured_hello', {'name': 'World'}) }}">Access the secured area</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="{{ path('_demo_login') }}">Go to the login page</a></li>
- {# <li><a href="{{ path('_demo_contact') }}">Send a Message</a></li> #}
- </ul>
-{% endblock %}
11 src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig
View
@@ -1,11 +0,0 @@
-{% extends "AcmeDemoBundle:Secured:layout.html.twig" %}
-
-{% block title "Hello " ~ name %}
-
-{% block content %}
- <h1>Hello {{ name }}!</h1>
-
- <a href="{{ path('_demo_secured_hello_admin', { 'name': name }) }}">Hello resource secured for <strong>admin</strong> only.</a>
-{% endblock %}
-
-{% set code = code(_self) %}
9 src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig
View
@@ -1,9 +0,0 @@
-{% extends "AcmeDemoBundle:Secured:layout.html.twig" %}
-
-{% block title "Hello " ~ name %}
-
-{% block content %}
- <h1>Hello {{ name }} secured for Admins only!</h1>
-{% endblock %}
-
-{% set code = code(_self) %}
6 src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig
View
@@ -1,6 +0,0 @@
-{% extends "AcmeDemoBundle::layout.html.twig" %}
-
-{% block content_header_more %}
- {{ parent() }}
- <li>logged in as <strong>{{ app.user ? app.user.username : 'Anonymous' }}</strong> - <a href="{{ path('_demo_logout') }}">Logout</a></li>
-{% endblock %}
29 src/Acme/DemoBundle/Resources/views/Secured/login.html.twig
View
@@ -1,29 +0,0 @@
-{% extends 'AcmeDemoBundle::layout.html.twig' %}
-
-{% block content %}
- <h1>Login</h1>
-
- <p>
- Choose between two default users: <em>user/userpass</em> <small>(ROLE_USER)</small> or <em>admin/adminpass</em> <small>(ROLE_ADMIN)</small>
- </p>
-
- {% if error %}
- <div class="error">{{ error.message }}</div>
- {% endif %}
-
- <form action="{{ path("_security_check") }}" method="post" id="login">
- <div>
- <label for="username">Username</label>
- <input type="text" id="username" name="_username" value="{{ last_username }}" />
- </div>
-
- <div>
- <label for="password">Password</label>
- <input type="password" id="password" name="_password" />
- </div>
-
- <input type="submit" class="symfony-button-grey" value="LOGIN" />
- </form>
-{% endblock %}
-
-{% set code = code(_self) %}
63 src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig
View
@@ -1,63 +0,0 @@
-{% extends 'AcmeDemoBundle::layout.html.twig' %}
-
-{% block title %}Symfony - Welcome{% endblock %}
-
-{% block content_header '' %}
-
-{% block content %}
- <h1>Welcome!</h1>
-
- <p>Congratulations! You have successfully installed a new Symfony application.</p>
-
- <div class="symfony-blocks-welcome">
- <div class="block-quick-tour">
- <div class="illustration">
- <img src="{{ asset('bundles/acmedemo/images/welcome-quick-tour.gif') }}" alt="Quick tour" />
- </div>
- <a class="symfony-button-green" href="http://symfony.com/doc/2.0/quick_tour/index.html">Read the Quick Tour</a>
- </div>
- {% if app.environment == 'dev' %}
- <div class="block-configure">
- <div class="illustration">
- <img src="{{ asset('bundles/acmedemo/images/welcome-configure.gif') }}" alt="Configure your appication" />
- </div>
- <a class="symfony-button-green" href="{{ path('_configurator_home') }}">Configure</a>
- </div>
- {% endif %}
- <div class="block-demo">
- <div class="illustration">
- <img src="{{ asset('bundles/acmedemo/images/welcome-demo.gif') }}" alt="Demo" />
- </div>
- <a class="symfony-button-green" href="{{ path('_demo') }}">Run The Demo</a>
- </div>
- </div>
-
- <div class="symfony-blocks-help">
- <div class="block-documentation">
- <ul>
- <li><strong>Documentation</strong></li>
- <li><a href="http://symfony.com/doc/2.0/book/index.html">The book</a></li>
- <li><a href="http://symfony.com/doc/2.0/reference/index.html">The cookbook</a></li>
- <li><a href="http://symfony.com/doc/2.0/glossary/index.html">Glossary</a></li>
- </ul>
- </div>
- <div class="block-documentation-more">
- <ul>
- <li>&nbsp;</li>
- <li><a href="http://symfony.com/doc/2.0/contributing/index.html">Contributing</a></li>
- <li><a href="http://trainings.sensiolabs.com">Trainings</a></li>
- <li><a href="http://books.sensiolabs.com">Books</a></li>
- </ul>
- </div>
- <div class="block-community">
- <ul>
- <li><strong>Community</strong></li>
- <li><a href="http://symfony.com/irc">IRC channel</a>
- <li><a href="http://symfony.com/mailing-lists">Mailing lists</a></li>
- <li><a href="http://forum.symfony-project.org">Forum</a></li>
- <li><a href="http://symfony.com/doc/2.0/contributing/index.html">How to be involved</a></li>
- <li><a href="http://symfony.com/doc/2.0/contributing/index.html">Contributing</a></li>
- </ul>
- </div>
- </div>
-{% endblock %}
49 src/Acme/DemoBundle/Resources/views/layout.html.twig
View
@@ -1,49 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" href="{{ asset('bundles/acmedemo/css/demo.css') }}" type="text/css" media="all" />
- <title>{% block title %}Demo Bundle{% endblock %}</title>
- <link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
- </head>
- <body>
- <div id="symfony-wrapper">
- <div id="symfony-header">
- <a href="{{ path('_welcome') }}">
- <img src="{{ asset('bundles/acmedemo/images/logo.gif') }}" alt="Symfony">
- </a>
- <form id="symfony-search" method="GET" action="http://symfony.com/search">
- <label for="symfony-search-field"><span>Search on Symfony Website</span></label>
- <input name="q" id="symfony-search-field" type="search" placeholder="Search on Symfony website" class="medium_txt">
- <input type="submit" class="symfony-button-grey" value="OK" />
- </form>
- </div>
-
- {% if app.session.flash('notice') %}
- <div class="flash-message">
- <em>Notice</em>: {{ app.session.flash('notice') }}
- </div>
- {% endif %}
-
- {% block content_header %}
- <ul id="menu">
- {% block content_header_more %}
- <li><a href="{{ path('_demo') }}">Demo Home</a></li>
- {% endblock %}
- </ul>
-
- <div style="clear: both"></div>
- {% endblock %}
-
- <div class="symfony-content">
- {% block content %}
- {% endblock %}
- </div>
-
- {% if code is defined %}
- <h2>Code behind this page</h2>
- <div class="symfony-content">{{ code|raw }}</div>
- {% endif %}
- </div>
- </body>
-</html>
74 src/Acme/DemoBundle/Twig/Extension/DemoExtension.php
View
@@ -1,74 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\Twig\Extension;
-
-use Symfony\Component\HttpKernel\KernelInterface;
-use Symfony\Bundle\TwigBundle\Loader\FilesystemLoader;
-
-class DemoExtension extends \Twig_Extension
-{
- protected $loader;
- protected $controller;
-
- public function __construct(FilesystemLoader $loader)
- {
- $this->loader = $loader;
- }
-
- public function setController($controller)
- {
- $this->controller = $controller;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getFunctions()
- {
- return array(
- 'code' => new \Twig_Function_Method($this, 'getCode', array('is_safe' => array('html'))),
- );
- }
-
- public function getCode($template)
- {
- $controller = htmlspecialchars($this->getControllerCode(), ENT_QUOTES, 'UTF-8');
- $template = htmlspecialchars($this->getTemplateCode($template), ENT_QUOTES, 'UTF-8');
-
- // remove the code block
- $template = str_replace('{% set code = code(_self) %}', '', $template);
-
- return <<<EOF
-<p><strong>Controller Code</strong></p>
-<pre>$controller</pre>
-
-<p><strong>Template Code</strong></p>
-<pre>$template</pre>
-EOF;
- }
-
- protected function getControllerCode()
- {
- $r = new \ReflectionClass($this->controller[0]);
- $m = $r->getMethod($this->controller[1]);
-
- $code = file($r->getFilename());
-
- return ' '.$m->getDocComment()."\n".implode('', array_slice($code, $m->getStartline() - 1, $m->getEndLine() - $m->getStartline() + 1));
- }
-
- protected function getTemplateCode($template)
- {
- return $this->loader->getSource($template->getTemplateName());
- }
-
- /**
- * Returns the name of the extension.
- *
- * @return string The extension name
- */
- public function getName()
- {
- return 'demo';
- }
-}
18 src/SFBCN/WebsiteBundle/Controller/DefaultController.php
View
@@ -0,0 +1,18 @@
+<?php
+
+namespace SFBCN\WebsiteBundle\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
+
+class DefaultController extends Controller
+{
+ /**
+ * @Route("/")
+ */
+ public function indexAction()
+ {
+ return new \Symfony\Component\HttpFoundation\Response('<html><head></head><body>Hola Barcelona</body></html>');
+ }
+}
29 src/SFBCN/WebsiteBundle/DependencyInjection/Configuration.php
View
@@ -0,0 +1,29 @@
+<?php
+
+namespace SFBCN\WebsiteBundle\DependencyInjection;
+
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+
+/**
+ * This is the class that validates and merges configuration from your app/config files
+ *
+ * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
+ */
+class Configuration implements ConfigurationInterface
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function getConfigTreeBuilder()
+ {
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('sfbcn_website');
+
+ // 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;
+ }
+}
28 src/SFBCN/WebsiteBundle/DependencyInjection/SFBCNWebsiteExtension.php
View
@@ -0,0 +1,28 @@
+<?php
+
+namespace SFBCN\WebsiteBundle\DependencyInjection;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+use Symfony\Component\DependencyInjection\Loader;
+
+/**
+ * This is the class that loads and manages your bundle configuration
+ *
+ * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
+ */
+class SFBCNWebsiteExtension extends Extension
+{
+ /**
+ * {@inheritDoc}
+ */
+ public function load(array $configs, ContainerBuilder $container)
+ {
+ $configuration = new Configuration();
+ $config = $this->processConfiguration($configuration, $configs);
+
+ $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+ $loader->load('services.yml');
+ }
+}
0  src/SFBCN/WebsiteBundle/Resources/config/services.yml
View
No changes.
0  src/SFBCN/WebsiteBundle/Resources/doc/index.rst
View
No changes.
0  src/SFBCN/WebsiteBundle/Resources/public/css/01-reset.css
View
No changes.
0  src/SFBCN/WebsiteBundle/Resources/translations/messages.es_ES.yml
View
No changes.
1  src/SFBCN/WebsiteBundle/Resources/views/Default/index.html.twig
View
@@ -0,0 +1 @@
+Hello {{ name }}!
9 src/SFBCN/WebsiteBundle/SFBCNWebsiteBundle.php
View
@@ -0,0 +1,9 @@
+<?php
+
+namespace SFBCN\WebsiteBundle;
+
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+class SFBCNWebsiteBundle extends Bundle
+{
+}
8 ...emoBundle/Tests/Controller/DemoControllerTest.php → ...Bundle/Tests/Controller/DefaultControllerTest.php
View
@@ -1,16 +1,16 @@
<?php
-namespace Acme\DemoBundle\Tests\Controller;
+namespace SFBCN\WebsiteBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
-class DemoControllerTest extends WebTestCase
+class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
- $client = $this->createClient();
+ $client = static::createClient();
- $crawler = $client->request('GET', '/demo/hello/Fabien');
+ $crawler = $client->request('GET', '/hello/Fabien');
$this->assertTrue($crawler->filter('html:contains("Hello Fabien")')->count() > 0);
}
Please sign in to comment.
Something went wrong with that request. Please try again.