Permalink
Browse files

BricksSiteBundle created

AcmeDemoBundle removed
  • Loading branch information...
inmarelibero committed Oct 1, 2012
1 parent ee32087 commit 18b656b8298a05b7d5225f372202e184de68dd9a
Showing with 126 additions and 836 deletions.
  1. +1 −1 app/AppKernel.php
  2. +5 −0 app/config/routing.yml
  3. +0 −13 app/config/routing_dev.yml
  4. +0 −9 src/Acme/DemoBundle/AcmeDemoBundle.php
  5. +0 −57 src/Acme/DemoBundle/Controller/DemoController.php
  6. +0 −69 src/Acme/DemoBundle/Controller/SecuredController.php
  7. +0 −18 src/Acme/DemoBundle/Controller/WelcomeController.php
  8. +0 −22 src/Acme/DemoBundle/DependencyInjection/AcmeDemoExtension.php
  9. +0 −25 src/Acme/DemoBundle/EventListener/ControllerListener.php
  10. +0 −20 src/Acme/DemoBundle/Form/ContactType.php
  11. +0 −18 src/Acme/DemoBundle/Resources/config/services.xml
  12. +0 −294 src/Acme/DemoBundle/Resources/public/css/demo.css
  13. BIN src/Acme/DemoBundle/Resources/public/images/blue-arrow.png
  14. BIN src/Acme/DemoBundle/Resources/public/images/field-background.gif
  15. BIN src/Acme/DemoBundle/Resources/public/images/logo.gif
  16. BIN src/Acme/DemoBundle/Resources/public/images/search.png
  17. BIN src/Acme/DemoBundle/Resources/public/images/welcome-configure.gif
  18. BIN src/Acme/DemoBundle/Resources/public/images/welcome-demo.gif
  19. BIN src/Acme/DemoBundle/Resources/public/images/welcome-quick-tour.gif
  20. +0 −15 src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig
  21. +0 −9 src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig
  22. +0 −14 src/Acme/DemoBundle/Resources/views/Demo/index.html.twig
  23. +0 −11 src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig
  24. +0 −9 src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig
  25. +0 −6 src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig
  26. +0 −29 src/Acme/DemoBundle/Resources/views/Secured/login.html.twig
  27. +0 −65 src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig
  28. +0 −49 src/Acme/DemoBundle/Resources/views/layout.html.twig
  29. +0 −80 src/Acme/DemoBundle/Twig/Extension/DemoExtension.php
  30. +9 −0 src/Bricks/SiteBundle/BricksSiteBundle.php
  31. +19 −0 src/Bricks/SiteBundle/Controller/DefaultController.php
  32. +28 −0 src/Bricks/SiteBundle/DependencyInjection/BricksSiteExtension.php
  33. +29 −0 src/Bricks/SiteBundle/DependencyInjection/Configuration.php
  34. +20 −0 src/Bricks/SiteBundle/Resources/config/services.xml
  35. 0 src/Bricks/SiteBundle/Resources/doc/index.rst
  36. +11 −0 src/Bricks/SiteBundle/Resources/translations/messages.fr.xlf
  37. +1 −0 src/Bricks/SiteBundle/Resources/views/Default/index.html.twig
  38. +3 −3 ...Controller/DemoControllerTest.php → Bricks/SiteBundle/Tests/Controller/DefaultControllerTest.php}
View
@@ -19,10 +19,10 @@ public function registerBundles()
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
+ new Bricks\SiteBundle\BricksSiteBundle(),
);
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();
View
@@ -1,3 +1,8 @@
+bricks_site:
+ resource: "@BricksSiteBundle/Controller/"
+ type: annotation
+ prefix: /
+
# Internal routing configuration to handle ESI
#_internal:
# resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
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
-
_wdt:
resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
prefix: /_wdt
@@ -1,9 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle;
-
-use Symfony\Component\HttpKernel\Bundle\Bundle;
-
-class AcmeDemoBundle extends Bundle
-{
-}
@@ -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());
- }
-}
@@ -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);
- }
-}
@@ -1,18 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-
-class WelcomeController extends Controller
-{
- public function indexAction()
- {
- /*
- * The action's view can be rendered using render() method
- * or @Template annotation as demonstrated in DemoController.
- *
- */
- return $this->render('AcmeDemoBundle:Welcome:index.html.twig');
- }
-}
@@ -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';
- }
-}
@@ -1,25 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\EventListener;
-
-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());
- }
- }
-}
@@ -1,20 +0,0 @@
-<?php
-
-namespace Acme\DemoBundle\Form;
-
-use Symfony\Component\Form\AbstractType;
-use Symfony\Component\Form\FormBuilderInterface;
-
-class ContactType extends AbstractType
-{
- public function buildForm(FormBuilderInterface $builder, array $options)
- {
- $builder->add('email', 'email');
- $builder->add('message', 'textarea');
- }
-
- public function getName()
- {
- return 'contact';
- }
-}
@@ -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\EventListener\ControllerListener">
- <tag name="kernel.event_listener" event="kernel.controller" method="onKernelController" />
- <argument type="service" id="twig.extension.acme.demo" />
- </service>
- </services>
-</container>
Oops, something went wrong.

0 comments on commit 18b656b

Please sign in to comment.