label($form) ?>
errors($form) ?>
diff --git a/cookbook/form/inherit_data_option.rst b/cookbook/form/inherit_data_option.rst
index 75db174ea3e..a4553f3847c 100644
--- a/cookbook/form/inherit_data_option.rst
+++ b/cookbook/form/inherit_data_option.rst
@@ -12,8 +12,8 @@ The ``inherit_data`` form field option can be very useful when you have some
duplicated fields in different entities. For example, imagine you have two
entities, a ``Company`` and a ``Customer``::
- // src/Acme/HelloBundle/Entity/Company.php
- namespace Acme\HelloBundle\Entity;
+ // src/AppBundle/Entity/Company.php
+ namespace AppBundle\Entity;
class Company
{
@@ -28,8 +28,8 @@ entities, a ``Company`` and a ``Customer``::
.. code-block:: php
- // src/Acme/HelloBundle/Entity/Customer.php
- namespace Acme\HelloBundle\Entity;
+ // src/AppBundle/Entity/Customer.php
+ namespace AppBundle\Entity;
class Customer
{
@@ -47,8 +47,8 @@ As you can see, each entity shares a few of the same fields: ``address``,
Start with building two forms for these entities, ``CompanyType`` and ``CustomerType``::
- // src/Acme/HelloBundle/Form/Type/CompanyType.php
- namespace Acme\HelloBundle\Form\Type;
+ // src/AppBundle/Form/Type/CompanyType.php
+ namespace AppBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
@@ -65,8 +65,8 @@ Start with building two forms for these entities, ``CompanyType`` and ``Customer
.. code-block:: php
- // src/Acme/HelloBundle/Form/Type/CustomerType.php
- namespace Acme\HelloBundle\Form\Type;
+ // src/AppBundle/Form/Type/CustomerType.php
+ namespace AppBundle\Form\Type;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\AbstractType;
@@ -85,8 +85,8 @@ Instead of including the duplicated fields ``address``, ``zipcode``, ``city``
and ``country`` in both of these forms, create a third form called ``LocationType``
for that::
- // src/Acme/HelloBundle/Form/Type/LocationType.php
- namespace Acme\HelloBundle\Form\Type;
+ // src/AppBundle/Form/Type/LocationType.php
+ namespace AppBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
@@ -130,25 +130,25 @@ access the properties of the ``Customer`` instance instead. Easy, eh?
Finally, make this work by adding the location form to your two original forms::
- // src/Acme/HelloBundle/Form/Type/CompanyType.php
+ // src/AppBundle/Form/Type/CompanyType.php
public function buildForm(FormBuilderInterface $builder, array $options)
{
// ...
$builder->add('foo', new LocationType(), array(
- 'data_class' => 'Acme\HelloBundle\Entity\Company'
+ 'data_class' => 'AppBundle\Entity\Company'
));
}
.. code-block:: php
- // src/Acme/HelloBundle/Form/Type/CustomerType.php
+ // src/AppBundle/Form/Type/CustomerType.php
public function buildForm(FormBuilderInterface $builder, array $options)
{
// ...
$builder->add('bar', new LocationType(), array(
- 'data_class' => 'Acme\HelloBundle\Entity\Customer'
+ 'data_class' => 'AppBundle\Entity\Customer'
));
}
diff --git a/cookbook/form/use_empty_data.rst b/cookbook/form/use_empty_data.rst
index a032379c8fd..423165267c0 100644
--- a/cookbook/form/use_empty_data.rst
+++ b/cookbook/form/use_empty_data.rst
@@ -34,11 +34,11 @@ One reason you might use this option is if you want to use a constructor
that takes arguments. Remember, the default ``data_class`` option calls
that constructor with no arguments::
- // src/Acme/DemoBundle/Form/Type/BlogType.php
+ // src/AppBundle/Form/Type/BlogType.php
// ...
use Symfony\Component\Form\AbstractType;
- use Acme\DemoBundle\Entity\Blog;
+ use AppBundle\Entity\Blog;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class BlogType extends AbstractType
diff --git a/cookbook/profiler/matchers.rst b/cookbook/profiler/matchers.rst
index 064e8fdd1b7..2a990aff333 100644
--- a/cookbook/profiler/matchers.rst
+++ b/cookbook/profiler/matchers.rst
@@ -67,8 +67,8 @@ profiler.
To enable the profiler when a ``ROLE_SUPER_ADMIN`` is logged in, you can use
something like::
- // src/Acme/DemoBundle/Profiler/SuperAdminMatcher.php
- namespace Acme\DemoBundle\Profiler;
+ // src/AppBundle/Profiler/SuperAdminMatcher.php
+ namespace AppBundle\Profiler;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpFoundation\Request;
@@ -95,26 +95,29 @@ Then, you need to configure the service:
.. code-block:: yaml
+ # app/config/services.yml
services:
- acme_demo.profiler.matcher.super_admin:
- class: Acme\DemoBundle\Profiler\SuperAdminMatcher
+ app.profiler.matcher.super_admin:
+ class: AppBundle\Profiler\SuperAdminMatcher
arguments: ["@security.context"]
.. code-block:: xml
+
-
+
.. code-block:: php
+ // app/config/services.php
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
- $container->setDefinition('acme_demo.profiler.matcher.super_admin', new Definition(
- 'Acme\DemoBundle\Profiler\SuperAdminMatcher',
+ $container->setDefinition('app.profiler.matcher.super_admin', new Definition(
+ 'AppBundle\Profiler\SuperAdminMatcher',
array(new Reference('security.context'))
);
@@ -130,7 +133,7 @@ profiler to use this service as the matcher:
# ...
profiler:
matcher:
- service: acme_demo.profiler.matcher.super_admin
+ service: app.profiler.matcher.super_admin
.. code-block:: xml
@@ -138,7 +141,7 @@ profiler to use this service as the matcher:
@@ -148,6 +151,6 @@ profiler to use this service as the matcher:
$container->loadFromExtension('framework', array(
// ...
'profiler' => array(
- 'service' => 'acme_demo.profiler.matcher.super_admin',
+ 'service' => 'app.profiler.matcher.super_admin',
),
));
diff --git a/cookbook/request/mime_type.rst b/cookbook/request/mime_type.rst
index 648c29e6d43..a16d8c15844 100644
--- a/cookbook/request/mime_type.rst
+++ b/cookbook/request/mime_type.rst
@@ -26,8 +26,8 @@ process and allows you to modify the request object.
Create the following class, replacing the path with a path to a bundle in your
project::
- // src/Acme/DemoBundle/RequestListener.php
- namespace Acme\DemoBundle;
+ // src/AppBundle/EventListener/RequestListener.php
+ namespace AppBundle\EventListener;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@@ -50,23 +50,23 @@ files and register it as a listener by adding the ``kernel.event_listener`` tag:
.. code-block:: yaml
- # app/config/config.yml
+ # app/config/services.yml
services:
- acme.demobundle.listener.request:
- class: Acme\DemoBundle\RequestListener
+ app.listener.request:
+ class: AppBundle\EventListener\RequestListener
tags:
- { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
.. code-block:: xml
-
+
-
+
addTag('kernel.event_listener', array(
'event' => 'kernel.request',
'method' => 'onKernelRequest',
));
- $container->setDefinition('acme.demobundle.listener.request', $definition);
+ $container->setDefinition('app.listener.request', $definition);
-At this point, the ``acme.demobundle.listener.request`` service has been
+At this point, the ``app.listener.request`` service has been
configured and will be notified when the Symfony kernel dispatches the
``kernel.request`` event.
diff --git a/cookbook/routing/extra_information.rst b/cookbook/routing/extra_information.rst
index c2b29421219..dbbe7706c46 100644
--- a/cookbook/routing/extra_information.rst
+++ b/cookbook/routing/extra_information.rst
@@ -17,7 +17,7 @@ arguments to your controller:
blog:
path: /blog/{page}
defaults:
- _controller: AcmeBlogBundle:Blog:index
+ _controller: AppBundle:Blog:index
page: 1
title: "Hello world!"
@@ -31,7 +31,7 @@ arguments to your controller:
http://symfony.com/schema/routing/routing-1.0.xsd">
- AcmeBlogBundle:Blog:index
+ AppBundle:Blog:index
1
Hello world!
@@ -45,7 +45,7 @@ arguments to your controller:
$collection = new RouteCollection();
$collection->add('blog', new Route('/blog/{page}', array(
- '_controller' => 'AcmeBlogBundle:Blog:index',
+ '_controller' => 'AppBundle:Blog:index',
'page' => 1,
'title' => 'Hello world!',
)));
diff --git a/cookbook/routing/method_parameters.rst b/cookbook/routing/method_parameters.rst
index 72bf7120afc..fdf6282de42 100644
--- a/cookbook/routing/method_parameters.rst
+++ b/cookbook/routing/method_parameters.rst
@@ -17,17 +17,17 @@ delete it by matching on GET, PUT and DELETE.
blog_show:
path: /blog/{slug}
- defaults: { _controller: AcmeDemoBundle:Blog:show }
+ defaults: { _controller: AppBundle:Blog:show }
methods: [GET]
blog_update:
path: /blog/{slug}
- defaults: { _controller: AcmeDemoBundle:Blog:update }
+ defaults: { _controller: AppBundle:Blog:update }
methods: [PUT]
blog_delete:
path: /blog/{slug}
- defaults: { _controller: AcmeDemoBundle:Blog:delete }
+ defaults: { _controller: AppBundle:Blog:delete }
methods: [DELETE]
.. code-block:: xml
@@ -39,15 +39,15 @@ delete it by matching on GET, PUT and DELETE.
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
- AcmeDemoBundle:Blog:show
+ AppBundle:Blog:show
- AcmeDemoBundle:Blog:update
+ AppBundle:Blog:update
- AcmeDemoBundle:Blog:delete
+ AppBundle:Blog:delete
@@ -58,15 +58,15 @@ delete it by matching on GET, PUT and DELETE.
$collection = new RouteCollection();
$collection->add('blog_show', new Route('/blog/{slug}', array(
- '_controller' => 'AcmeDemoBundle:Blog:show',
+ '_controller' => 'AppBundle:Blog:show',
), array(), array(), '', array(), array('GET')));
$collection->add('blog_update', new Route('/blog/{slug}', array(
- '_controller' => 'AcmeDemoBundle:Blog:update',
+ '_controller' => 'AppBundle:Blog:update',
), array(), array(), '', array(), array('PUT')));
$collection->add('blog_delete', new Route('/blog/{slug}', array(
- '_controller' => 'AcmeDemoBundle:Blog:delete',
+ '_controller' => 'AppBundle:Blog:delete',
), array(), array(), '', array('DELETE')));
return $collection;
diff --git a/cookbook/routing/redirect_in_config.rst b/cookbook/routing/redirect_in_config.rst
index 6715e3ffdce..619824f31df 100644
--- a/cookbook/routing/redirect_in_config.rst
+++ b/cookbook/routing/redirect_in_config.rst
@@ -28,7 +28,7 @@ action to redirect to this new url:
# load some routes - one should ultimately have the path "/app"
AppBundle:
- resource: "@AcmeAppBundle/Controller/"
+ resource: "@AppBundle/Controller/"
type: annotation
prefix: /app
@@ -50,7 +50,7 @@ action to redirect to this new url:
http://symfony.com/schema/routing/routing-1.0.xsd">
-
@@ -72,13 +72,10 @@ action to redirect to this new url:
$collection = new RouteCollection();
// load some routes - one should ultimately have the path "/app"
- $acmeApp = $loader->import(
- "@AcmeAppBundle/Controller/",
- "annotation"
- );
- $acmeApp->setPrefix('/app');
+ $appRoutes = $loader->import("@AppBundle/Controller/", "annotation");
+ $appRoutes->setPrefix('/app');
- $collection->addCollection($acmeApp);
+ $collection->addCollection($appRoutes);
// redirecting the root
$collection->add('root', new Route('/', array(
diff --git a/cookbook/routing/redirect_trailing_slash.rst b/cookbook/routing/redirect_trailing_slash.rst
index 01b0010fc1e..51d29d120bb 100644
--- a/cookbook/routing/redirect_trailing_slash.rst
+++ b/cookbook/routing/redirect_trailing_slash.rst
@@ -12,8 +12,8 @@ Create a controller that will match any URL with a trailing slash, remove
the trailing slash (keeping query parameters if any) and redirect to the
new URL with a 301 response status code::
- // src/Acme/DemoBundle/Controller/RedirectingController.php
- namespace Acme\DemoBundle\Controller;
+ // src/AppBundle/Controller/RedirectingController.php
+ namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
@@ -41,7 +41,7 @@ system, as explained below:
remove_trailing_slash:
path: /{url}
- defaults: { _controller: AcmeDemoBundle:Redirecting:removeTrailingSlash }
+ defaults: { _controller: AppBundle:Redirecting:removeTrailingSlash }
requirements:
url: .*/$
methods: [GET]
@@ -51,7 +51,7 @@ system, as explained below:
- AcmeDemoBundle:Redirecting:removeTrailingSlash
+ AppBundle:Redirecting:removeTrailingSlash
.*/$
@@ -67,7 +67,7 @@ system, as explained below:
new Route(
'/{url}',
array(
- '_controller' => 'AcmeDemoBundle:Redirecting:removeTrailingSlash',
+ '_controller' => 'AppBundle:Redirecting:removeTrailingSlash',
),
array(
'url' => '.*/$',
diff --git a/cookbook/routing/scheme.rst b/cookbook/routing/scheme.rst
index e502750ea9e..f643e1bd946 100644
--- a/cookbook/routing/scheme.rst
+++ b/cookbook/routing/scheme.rst
@@ -14,7 +14,7 @@ the URI scheme via schemes:
secure:
path: /secure
- defaults: { _controller: AcmeDemoBundle:Main:secure }
+ defaults: { _controller: AppBundle:Main:secure }
schemes: [https]
.. code-block:: xml
@@ -26,7 +26,7 @@ the URI scheme via schemes:
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
- AcmeDemoBundle:Main:secure
+ AppBundle:Main:secure
@@ -37,7 +37,7 @@ the URI scheme via schemes:
$collection = new RouteCollection();
$collection->add('secure', new Route('/secure', array(
- '_controller' => 'AcmeDemoBundle:Main:secure',
+ '_controller' => 'AppBundle:Main:secure',
), array(), array(), '', array('https')));
return $collection;
diff --git a/cookbook/routing/service_container_parameters.rst b/cookbook/routing/service_container_parameters.rst
index a3c84db5c04..4d55234cd07 100644
--- a/cookbook/routing/service_container_parameters.rst
+++ b/cookbook/routing/service_container_parameters.rst
@@ -21,9 +21,9 @@ inside your routing configuration:
# app/config/routing.yml
contact:
path: /{_locale}/contact
- defaults: { _controller: AcmeDemoBundle:Main:contact }
+ defaults: { _controller: AppBundle:Main:contact }
requirements:
- _locale: "%acme_demo.locales%"
+ _locale: "%app.locales%"
.. code-block:: xml
@@ -34,8 +34,8 @@ inside your routing configuration:
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
- AcmeDemoBundle:Main:contact
- %acme_demo.locales%
+ AppBundle:Main:contact
+ %app.locales%
@@ -47,14 +47,14 @@ inside your routing configuration:
$collection = new RouteCollection();
$collection->add('contact', new Route('/{_locale}/contact', array(
- '_controller' => 'AcmeDemoBundle:Main:contact',
+ '_controller' => 'AppBundle:Main:contact',
), array(
- '_locale' => '%acme_demo.locales%',
+ '_locale' => '%app.locales%',
)));
return $collection;
-You can now control and set the ``acme_demo.locales`` parameter somewhere
+You can now control and set the ``app.locales`` parameter somewhere
in your container:
.. configuration-block::
@@ -63,19 +63,19 @@ in your container:
# app/config/config.yml
parameters:
- acme_demo.locales: en|es
+ app.locales: en|es
.. code-block:: xml
- en|es
+ en|es
.. code-block:: php
// app/config/config.php
- $container->setParameter('acme_demo.locales', 'en|es');
+ $container->setParameter('app.locales', 'en|es');
You can also use a parameter to define your route path (or part of your
path):
@@ -86,8 +86,8 @@ path):
# app/config/routing.yml
some_route:
- path: /%acme_demo.route_prefix%/contact
- defaults: { _controller: AcmeDemoBundle:Main:contact }
+ path: /%app.route_prefix%/contact
+ defaults: { _controller: AppBundle:Main:contact }
.. code-block:: xml
@@ -97,8 +97,8 @@ path):
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
-
- AcmeDemoBundle:Main:contact
+
+ AppBundle:Main:contact
@@ -109,8 +109,8 @@ path):
use Symfony\Component\Routing\Route;
$collection = new RouteCollection();
- $collection->add('some_route', new Route('/%acme_demo.route_prefix%/contact', array(
- '_controller' => 'AcmeDemoBundle:Main:contact',
+ $collection->add('some_route', new Route('/%app.route_prefix%/contact', array(
+ '_controller' => 'AppBundle:Main:contact',
)));
return $collection;
diff --git a/cookbook/routing/slash_in_parameter.rst b/cookbook/routing/slash_in_parameter.rst
index db2078a2bc3..c8b1b53e2bc 100644
--- a/cookbook/routing/slash_in_parameter.rst
+++ b/cookbook/routing/slash_in_parameter.rst
@@ -28,7 +28,7 @@ a more permissive regex path.
_hello:
path: /hello/{username}
- defaults: { _controller: AcmeDemoBundle:Demo:hello }
+ defaults: { _controller: AppBundle:Demo:hello }
requirements:
username: .+
@@ -41,7 +41,7 @@ a more permissive regex path.
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
- AcmeDemoBundle:Demo:hello
+ AppBundle:Demo:hello
.+
@@ -53,7 +53,7 @@ a more permissive regex path.
$collection = new RouteCollection();
$collection->add('_hello', new Route('/hello/{username}', array(
- '_controller' => 'AcmeDemoBundle:Demo:hello',
+ '_controller' => 'AppBundle:Demo:hello',
), array(
'username' => '.+',
)));
diff --git a/cookbook/security/acl.rst b/cookbook/security/acl.rst
index b26b271b4db..e3fc0cad006 100644
--- a/cookbook/security/acl.rst
+++ b/cookbook/security/acl.rst
@@ -99,8 +99,8 @@ Creating an ACL and Adding an ACE
.. code-block:: php
- // src/Acme/DemoBundle/Controller/BlogController.php
- namespace Acme\DemoBundle\Controller;
+ // src/AppBundle/Controller/BlogController.php
+ namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
@@ -167,7 +167,7 @@ Checking Access
.. code-block:: php
- // src/Acme/DemoBundle/Controller/BlogController.php
+ // src/AppBundle/Controller/BlogController.php
// ...
diff --git a/cookbook/security/custom_authentication_provider.rst b/cookbook/security/custom_authentication_provider.rst
index c2baec636d3..af79e3ec027 100644
--- a/cookbook/security/custom_authentication_provider.rst
+++ b/cookbook/security/custom_authentication_provider.rst
@@ -51,8 +51,8 @@ provider.
.. code-block:: php
- // src/Acme/DemoBundle/Security/Authentication/Token/WsseUserToken.php
- namespace Acme\DemoBundle\Security\Authentication\Token;
+ // src/AppBundle/Security/Authentication/Token/WsseUserToken.php
+ namespace AppBundle\Security\Authentication\Token;
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
@@ -97,8 +97,8 @@ set an authenticated token in the security context if successful.
.. code-block:: php
- // src/Acme/DemoBundle/Security/Firewall/WsseListener.php
- namespace Acme\DemoBundle\Security\Firewall;
+ // src/AppBundle/Security/Firewall/WsseListener.php
+ namespace AppBundle\Security\Firewall;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@@ -106,7 +106,7 @@ set an authenticated token in the security context if successful.
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
- use Acme\DemoBundle\Security\Authentication\Token\WsseUserToken;
+ use AppBundle\Security\Authentication\Token\WsseUserToken;
class WsseListener implements ListenerInterface
{
@@ -193,15 +193,15 @@ the ``PasswordDigest`` header value matches with the user's password.
.. code-block:: php
- // src/Acme/DemoBundle/Security/Authentication/Provider/WsseProvider.php
- namespace Acme\DemoBundle\Security\Authentication\Provider;
+ // src/AppBundle/Security/Authentication/Provider/WsseProvider.php
+ namespace AppBundle\Security\Authentication\Provider;
use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\NonceExpiredException;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
- use Acme\DemoBundle\Security\Authentication\Token\WsseUserToken;
+ use AppBundle\Security\Authentication\Token\WsseUserToken;
class WsseProvider implements AuthenticationProviderInterface
{
@@ -290,8 +290,8 @@ create a class which implements
.. code-block:: php
- // src/Acme/DemoBundle/DependencyInjection/Security/Factory/WsseFactory.php
- namespace Acme\DemoBundle\DependencyInjection\Security\Factory;
+ // src/AppBundle/DependencyInjection/Security/Factory/WsseFactory.php
+ namespace AppBundle\DependencyInjection\Security\Factory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
@@ -383,32 +383,32 @@ to service ids that do not exist yet: ``wsse.security.authentication.provider``
.. code-block:: yaml
- # src/Acme/DemoBundle/Resources/config/services.yml
+ # src/AppBundle/Resources/config/services.yml
services:
wsse.security.authentication.provider:
- class: Acme\DemoBundle\Security\Authentication\Provider\WsseProvider
+ class: AppBundle\Security\Authentication\Provider\WsseProvider
arguments: ["", "%kernel.cache_dir%/security/nonces"]
wsse.security.authentication.listener:
- class: Acme\DemoBundle\Security\Firewall\WsseListener
+ class: AppBundle\Security\Firewall\WsseListener
arguments: ["@security.context", "@security.authentication.manager"]
.. code-block:: xml
-
+
+ class="AppBundle\Security\Authentication\Provider\WsseProvider" public="false">
%kernel.cache_dir%/security/nonces
+ class="AppBundle\Security\Firewall\WsseListener" public="false">
@@ -417,13 +417,13 @@ to service ids that do not exist yet: ``wsse.security.authentication.provider``
.. code-block:: php
- // src/Acme/DemoBundle/Resources/config/services.php
+ // src/AppBundle/Resources/config/services.php
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
$container->setDefinition('wsse.security.authentication.provider',
new Definition(
- 'Acme\DemoBundle\Security\Authentication\Provider\WsseProvider', array(
+ 'AppBundle\Security\Authentication\Provider\WsseProvider', array(
'',
'%kernel.cache_dir%/security/nonces',
)
@@ -432,7 +432,7 @@ to service ids that do not exist yet: ``wsse.security.authentication.provider``
$container->setDefinition('wsse.security.authentication.listener',
new Definition(
- 'Acme\DemoBundle\Security\Firewall\WsseListener', array(
+ 'AppBundle\Security\Firewall\WsseListener', array(
new Reference('security.context'),
new Reference('security.authentication.manager'),
)
@@ -444,14 +444,14 @@ factory in your bundle class:
.. code-block:: php
- // src/Acme/DemoBundle/AcmeDemoBundle.php
- namespace Acme\DemoBundle;
+ // src/AppBundle/AppBundle.php
+ namespace AppBundle;
- use Acme\DemoBundle\DependencyInjection\Security\Factory\WsseFactory;
+ use AppBundle\DependencyInjection\Security\Factory\WsseFactory;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
- class AcmeDemoBundle extends Bundle
+ class AppBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
diff --git a/cookbook/security/securing_services.rst b/cookbook/security/securing_services.rst
index 3fc3ef16197..dde89a90e8e 100644
--- a/cookbook/security/securing_services.rst
+++ b/cookbook/security/securing_services.rst
@@ -30,8 +30,8 @@ role. Before you add security, the class looks something like this:
.. code-block:: php
- // src/Acme/HelloBundle/Newsletter/NewsletterManager.php
- namespace Acme\HelloBundle\Newsletter;
+ // src/AppBundle/Newsletter/NewsletterManager.php
+ namespace AppBundle\Newsletter;
class NewsletterManager
{
@@ -51,7 +51,7 @@ check, this is an ideal candidate for constructor injection, which guarantees
that the security context object will be available inside the ``NewsletterManager``
class::
- namespace Acme\HelloBundle\Newsletter;
+ namespace AppBundle\Newsletter;
use Symfony\Component\Security\Core\SecurityContextInterface;
@@ -73,36 +73,36 @@ Then in your service configuration, you can inject the service:
.. code-block:: yaml
- # src/Acme/HelloBundle/Resources/config/services.yml
+ # app/config/services.yml
services:
newsletter_manager:
- class: Acme\HelloBundle\Newsletter\NewsletterManager
+ class: AppBundle\Newsletter\NewsletterManager
arguments: ["@security.context"]
.. code-block:: xml
-
+
-
+
.. code-block:: php
- // src/Acme/HelloBundle/Resources/config/services.php
+ // app/config/services.php
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
$container->setDefinition('newsletter_manager', new Definition(
- 'Acme\HelloBundle\Newsletter\NewsletterManager',
+ 'AppBundle\Newsletter\NewsletterManager',
array(new Reference('security.context'))
));
The injected service can then be used to perform the security check when the
``sendNewsletter()`` method is called::
- namespace Acme\HelloBundle\Newsletter;
+ namespace AppBundle\Newsletter;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\SecurityContextInterface;
@@ -148,7 +148,7 @@ the :ref:`sidebar ` below):
.. code-block:: yaml
- # src/Acme/HelloBundle/Resources/config/services.yml
+ # app/services.yml
# ...
services:
@@ -159,11 +159,11 @@ the :ref:`sidebar ` below):
.. code-block:: xml
-
+
-
+
@@ -171,12 +171,12 @@ the :ref:`sidebar ` below):
.. code-block:: php
- // src/Acme/HelloBundle/Resources/config/services.php
+ // app/services.php
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
$definition = new Definition(
- 'Acme\HelloBundle\Newsletter\NewsletterManager',
+ 'AppBundle\Newsletter\NewsletterManager',
array(new Reference('security.context'))
));
$definition->addTag('security.secure_service');
@@ -184,7 +184,7 @@ the :ref:`sidebar ` below):
You can then achieve the same results as above using an annotation::
- namespace Acme\HelloBundle\Newsletter;
+ namespace AppBundle\Newsletter;
use JMS\SecurityExtraBundle\Annotation\Secure;
// ...
diff --git a/cookbook/security/target_path.rst b/cookbook/security/target_path.rst
index c6c97de7b21..e9da39cf9ca 100644
--- a/cookbook/security/target_path.rst
+++ b/cookbook/security/target_path.rst
@@ -25,29 +25,29 @@ configuration file. This can be done from your main configuration file (in
.. code-block:: yaml
- # src/Acme/HelloBundle/Resources/config/services.yml
+ # app/config/services.yml
parameters:
# ...
- security.exception_listener.class: Acme\HelloBundle\Security\Firewall\ExceptionListener
+ security.exception_listener.class: AppBundle\Security\Firewall\ExceptionListener
.. code-block:: xml
-
+
- Acme\HelloBundle\Security\Firewall\ExceptionListener
+ AppBundle\Security\Firewall\ExceptionListener
.. code-block:: php
- // src/Acme/HelloBundle/Resources/config/services.php
+ // app/config/services.php
// ...
- $container->setParameter('security.exception_listener.class', 'Acme\HelloBundle\Security\Firewall\ExceptionListener');
+ $container->setParameter('security.exception_listener.class', 'AppBundle\Security\Firewall\ExceptionListener');
Next, create your own ``ExceptionListener``::
- // src/Acme/HelloBundle/Security/Firewall/ExceptionListener.php
- namespace Acme\HelloBundle\Security\Firewall;
+ // src/AppBundle/Security/Firewall/ExceptionListener.php
+ namespace AppBundle\Security\Firewall;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Firewall\ExceptionListener as BaseExceptionListener;
diff --git a/cookbook/security/voters.rst b/cookbook/security/voters.rst
index 60df1439d52..9f0665d4fcd 100644
--- a/cookbook/security/voters.rst
+++ b/cookbook/security/voters.rst
@@ -37,8 +37,8 @@ and compare the IP address against a set of blacklisted IP addresses:
.. code-block:: php
- // src/Acme/DemoBundle/Security/Authorization/Voter/ClientIpVoter.php
- namespace Acme\DemoBundle\Security\Authorization\Voter;
+ // src/AppBundle/Security/Authorization/Voter/ClientIpVoter.php
+ namespace AppBundle\Security\Authorization\Voter;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
@@ -106,7 +106,7 @@ and tag it as a ``security.voter``:
# src/Acme/AcmeBundle/Resources/config/services.yml
services:
security.access.blacklist_voter:
- class: Acme\DemoBundle\Security\Authorization\Voter\ClientIpVoter
+ class: AppBundle\Security\Authorization\Voter\ClientIpVoter
arguments: ["@service_container", [123.123.123.123, 171.171.171.171]]
public: false
tags:
@@ -116,7 +116,7 @@ and tag it as a ``security.voter``:
+ class="AppBundle\Security\Authorization\Voter\ClientIpVoter" public="false">
123.123.123.123
@@ -132,7 +132,7 @@ and tag it as a ``security.voter``:
use Symfony\Component\DependencyInjection\Reference;
$definition = new Definition(
- 'Acme\DemoBundle\Security\Authorization\Voter\ClientIpVoter',
+ 'AppBundle\Security\Authorization\Voter\ClientIpVoter',
array(
new Reference('service_container'),
array('123.123.123.123', '171.171.171.171'),
diff --git a/cookbook/security/voters_data_permission.rst b/cookbook/security/voters_data_permission.rst
index 7359b0b27cb..7ac729b9892 100644
--- a/cookbook/security/voters_data_permission.rst
+++ b/cookbook/security/voters_data_permission.rst
@@ -56,8 +56,8 @@ Creating the custom Voter
The goal is to create a voter that checks if a user has access to view or
edit a particular object. Here's an example implementation::
- // src/Acme/DemoBundle/Security/Authorization/Voter/PostVoter.php
- namespace Acme\DemoBundle\Security\Authorization\Voter;
+ // src/AppBundle/Security/Authorization/Voter/PostVoter.php
+ namespace AppBundle\Security\Authorization\Voter;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -78,13 +78,13 @@ edit a particular object. Here's an example implementation::
public function supportsClass($class)
{
- $supportedClass = 'Acme\DemoBundle\Entity\Post';
+ $supportedClass = 'AppBundle\Entity\Post';
return $supportedClass === $class || is_subclass_of($class, $supportedClass);
}
/**
- * @var \Acme\DemoBundle\Entity\Post $post
+ * @var \AppBundle\Entity\Post $post
*/
public function vote(TokenInterface $token, $post, array $attributes)
{
@@ -153,24 +153,24 @@ and tag it with ``security.voter``:
.. code-block:: yaml
- # src/Acme/DemoBundle/Resources/config/services.yml
+ # src/AppBundle/Resources/config/services.yml
services:
security.access.post_voter:
- class: Acme\DemoBundle\Security\Authorization\Voter\PostVoter
+ class: AppBundle\Security\Authorization\Voter\PostVoter
public: false
tags:
- { name: security.voter }
.. code-block:: xml
-
+
@@ -179,11 +179,11 @@ and tag it with ``security.voter``:
.. code-block:: php
- // src/Acme/DemoBundle/Resources/config/services.php
+ // src/AppBundle/Resources/config/services.php
$container
->register(
'security.access.post_document_voter',
- 'Acme\DemoBundle\Security\Authorization\Voter\PostVoter'
+ 'AppBundle\Security\Authorization\Voter\PostVoter'
)
->addTag('security.voter')
;
@@ -196,8 +196,8 @@ from the security context is called.
.. code-block:: php
- // src/Acme/DemoBundle/Controller/PostController.php
- namespace Acme\DemoBundle\Controller;
+ // src/AppBundle/Controller/PostController.php
+ namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
diff --git a/cookbook/service_container/event_listener.rst b/cookbook/service_container/event_listener.rst
index e5ae89dd6bd..59fb5978e4c 100644
--- a/cookbook/service_container/event_listener.rst
+++ b/cookbook/service_container/event_listener.rst
@@ -14,8 +14,8 @@ you will create a service that will act as an Exception Listener, allowing
you to modify how exceptions are shown by your application. The ``KernelEvents::EXCEPTION``
event is just one of the core kernel events::
- // src/Acme/DemoBundle/EventListener/AcmeExceptionListener.php
- namespace Acme\DemoBundle\EventListener;
+ // src/AppBundle/EventListener/AcmeExceptionListener.php
+ namespace AppBundle\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpFoundation\Response;
@@ -71,25 +71,25 @@ using a special "tag":
.. code-block:: yaml
- # app/config/config.yml
+ # app/config/services.yml
services:
kernel.listener.your_listener_name:
- class: Acme\DemoBundle\EventListener\AcmeExceptionListener
+ class: AppBundle\EventListener\AcmeExceptionListener
tags:
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException }
.. code-block:: xml
-
-
+
+
.. code-block:: php
- // app/config/config.php
+ // app/config/services.php
$container
- ->register('kernel.listener.your_listener_name', 'Acme\DemoBundle\EventListener\AcmeExceptionListener')
+ ->register('kernel.listener.your_listener_name', 'AppBundle\EventListener\AcmeExceptionListener')
->addTag('kernel.event_listener', array('event' => 'kernel.exception', 'method' => 'onKernelException'))
;
@@ -108,8 +108,8 @@ sub-requests), which is why when working with the ``KernelEvents::REQUEST``
event, you might need to check the type of the request. This can be easily
done as follow::
- // src/Acme/DemoBundle/EventListener/AcmeRequestListener.php
- namespace Acme\DemoBundle\EventListener;
+ // src/AppBundle/EventListener/AcmeRequestListener.php
+ namespace AppBundle\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernel;
diff --git a/cookbook/service_container/scopes.rst b/cookbook/service_container/scopes.rst
index 70ad093561e..5ab227576dc 100644
--- a/cookbook/service_container/scopes.rst
+++ b/cookbook/service_container/scopes.rst
@@ -106,8 +106,8 @@ drawbacks. For synchronized services (like the ``request``), using setter
injection is the best option as it has no drawbacks and everything works
without any special code in your service or in your definition::
- // src/Acme/HelloBundle/Mail/Mailer.php
- namespace Acme\HelloBundle\Mail;
+ // src/AppBundle/Mail/Mailer.php
+ namespace AppBundle\Mail;
use Symfony\Component\HttpFoundation\Request;
@@ -144,19 +144,19 @@ your code. This should also be taken into account when declaring your service:
.. code-block:: yaml
- # src/Acme/HelloBundle/Resources/config/services.yml
+ # app/config/services.yml
services:
greeting_card_manager:
- class: Acme\HelloBundle\Mail\GreetingCardManager
+ class: AppBundle\Mail\GreetingCardManager
calls:
- [setRequest, ["@?request="]]
.. code-block:: xml
-
+
@@ -166,13 +166,13 @@ your code. This should also be taken into account when declaring your service:
.. code-block:: php
- // src/Acme/HelloBundle/Resources/config/services.php
+ // app/config/services.php
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ContainerInterface;
$definition = $container->setDefinition(
'greeting_card_manager',
- new Definition('Acme\HelloBundle\Mail\GreetingCardManager')
+ new Definition('AppBundle\Mail\GreetingCardManager')
)
->addMethodCall('setRequest', array(
new Reference('request', ContainerInterface::NULL_ON_INVALID_REFERENCE, false)
@@ -225,19 +225,19 @@ Changing the scope of a service should be done in its definition:
.. code-block:: yaml
- # src/Acme/HelloBundle/Resources/config/services.yml
+ # app/config/services.yml
services:
greeting_card_manager:
- class: Acme\HelloBundle\Mail\GreetingCardManager
+ class: AppBundle\Mail\GreetingCardManager
scope: request
arguments: ["@request"]
.. code-block:: xml
-
+
@@ -245,13 +245,13 @@ Changing the scope of a service should be done in its definition:
.. code-block:: php
- // src/Acme/HelloBundle/Resources/config/services.php
+ // app/config/services.php
use Symfony\Component\DependencyInjection\Definition;
$definition = $container->setDefinition(
'greeting_card_manager',
new Definition(
- 'Acme\HelloBundle\Mail\GreetingCardManager',
+ 'AppBundle\Mail\GreetingCardManager',
array(new Reference('request'),
))
)->setScope('request');
@@ -266,8 +266,8 @@ twig extension must be in the ``container`` scope as the Twig environment
needs it as a dependency). In these cases, you can pass the entire container
into your service::
- // src/Acme/HelloBundle/Mail/Mailer.php
- namespace Acme\HelloBundle\Mail;
+ // src/AppBundle/Mail/Mailer.php
+ namespace AppBundle\Mail;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -300,30 +300,30 @@ The service config for this class would look something like this:
.. code-block:: yaml
- # src/Acme/HelloBundle/Resources/config/services.yml
+ # app/config/services.yml
services:
my_mailer:
- class: Acme\HelloBundle\Mail\Mailer
+ class: AppBundle\Mail\Mailer
arguments: ["@service_container"]
# scope: container can be omitted as it is the default
.. code-block:: xml
-
+
-
+
.. code-block:: php
- // src/Acme/HelloBundle/Resources/config/services.php
+ // app/config/services.php
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
$container->setDefinition('my_mailer', new Definition(
- 'Acme\HelloBundle\Mail\Mailer',
+ 'AppBundle\Mail\Mailer',
array(new Reference('service_container'))
));
diff --git a/cookbook/session/locale_sticky_session.rst b/cookbook/session/locale_sticky_session.rst
index 172930869d7..2aa61eed497 100644
--- a/cookbook/session/locale_sticky_session.rst
+++ b/cookbook/session/locale_sticky_session.rst
@@ -19,8 +19,8 @@ The listener will look something like this. Typically, ``_locale`` is used
as a routing parameter to signify the locale, though it doesn't really matter
how you determine the desired locale from the request::
- // src/Acme/LocaleBundle/EventListener/LocaleListener.php
- namespace Acme\LocaleBundle\EventListener;
+ // src/AppBundle/EventListener/LocaleListener.php
+ namespace AppBundle\EventListener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
@@ -67,16 +67,16 @@ Then register the listener:
.. code-block:: yaml
services:
- acme_locale.locale_listener:
- class: Acme\LocaleBundle\EventListener\LocaleListener
+ app.locale_listener:
+ class: AppBundle\EventListener\LocaleListener
arguments: ["%kernel.default_locale%"]
tags:
- { name: kernel.event_subscriber }
.. code-block:: xml
-
+
%kernel.default_locale%
@@ -87,8 +87,8 @@ Then register the listener:
use Symfony\Component\DependencyInjection\Definition;
$container
- ->setDefinition('acme_locale.locale_listener', new Definition(
- 'Acme\LocaleBundle\EventListener\LocaleListener',
+ ->setDefinition('app.locale_listener', new Definition(
+ 'AppBundle\EventListener\LocaleListener',
array('%kernel.default_locale%')
))
->addTag('kernel.event_subscriber')
diff --git a/cookbook/templating/PHP.rst b/cookbook/templating/PHP.rst
index 8331f279b1b..5c7f3a2fd86 100644
--- a/cookbook/templating/PHP.rst
+++ b/cookbook/templating/PHP.rst
@@ -49,21 +49,21 @@ You can now render a PHP template instead of a Twig one simply by using the
``.php`` extension in the template name instead of ``.twig``. The controller
below renders the ``index.html.php`` template::
- // src/Acme/HelloBundle/Controller/HelloController.php
+ // src/AppBundle/Controller/HelloController.php
// ...
public function indexAction($name)
{
return $this->render(
- 'AcmeHelloBundle:Hello:index.html.php',
+ 'AppBundle:Hello:index.html.php',
array('name' => $name)
);
}
You can also use the `@Template`_ shortcut to render the default
-``AcmeHelloBundle:Hello:index.html.php`` template::
+``AppBundle:Hello:index.html.php`` template::
- // src/Acme/HelloBundle/Controller/HelloController.php
+ // src/AppBundle/Controller/HelloController.php
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
// ...
@@ -88,19 +88,19 @@ You can also use the `@Template`_ shortcut to render the default
// ...
// namespaced templates will no longer work in controllers
- $this->render('@Acme/Default/index.html.twig');
+ $this->render('@App/Default/index.html.twig');
// you must use the traditional template notation
- $this->render('AcmeBundle:Default:index.html.twig');
+ $this->render('AppBundle:Default:index.html.twig');
}
.. code-block:: jinja
{# inside a Twig template, namespaced templates work as expected #}
- {{ include('@Acme/Default/index.html.twig') }}
+ {{ include('@App/Default/index.html.twig') }}
{# traditional template notation will also work #}
- {{ include('AcmeBundle:Default:index.html.twig') }}
+ {{ include('AppBundle:Default:index.html.twig') }}
.. index::
@@ -119,12 +119,12 @@ the ``extend()`` call:
.. code-block:: html+php
-
- extend('AcmeHelloBundle::layout.html.php') ?>
+
+ extend('AppBundle::layout.html.php') ?>
Hello !
-The ``AcmeHelloBundle::layout.html.php`` notation sounds familiar, doesn't it? It
+The ``AppBundle::layout.html.php`` notation sounds familiar, doesn't it? It
is the same notation used to reference a template. The ``::`` part simply
means that the controller element is empty, so the corresponding file is
directly stored under ``views/``.
@@ -133,7 +133,7 @@ Now, have a look at the ``layout.html.php`` file:
.. code-block:: html+php
-
+
extend('::base.html.php') ?>
Hello Application
@@ -181,8 +181,8 @@ decorating the template. In the ``index.html.php`` template, define a
.. code-block:: html+php
-
- extend('AcmeHelloBundle::layout.html.php') ?>
+
+ extend('AppBundle::layout.html.php') ?>
set('title', 'Hello World Application') ?>
@@ -223,17 +223,17 @@ Create a ``hello.html.php`` template:
.. code-block:: html+php
-
+
Hello !
And change the ``index.html.php`` template to include it:
.. code-block:: html+php
-
- extend('AcmeHelloBundle::layout.html.php') ?>
+
+ extend('AppBundle::layout.html.php') ?>
- render('AcmeHelloBundle:Hello:hello.html.php', array('name' => $name)) ?>
+ render('AppBundle:Hello:hello.html.php', array('name' => $name)) ?>
The ``render()`` method evaluates and returns the content of another template
(this is the exact same method as the one used in the controller).
@@ -253,18 +253,18 @@ If you create a ``fancy`` action, and want to include it into the
.. code-block:: html+php
-
+
render(
- new \Symfony\Component\HttpKernel\Controller\ControllerReference('AcmeHelloBundle:Hello:fancy', array(
+ new \Symfony\Component\HttpKernel\Controller\ControllerReference('AppBundle:Hello:fancy', array(
'name' => $name,
'color' => 'green',
))
) ?>
-Here, the ``AcmeHelloBundle:Hello:fancy`` string refers to the ``fancy`` action of the
+Here, the ``AppBundle:Hello:fancy`` string refers to the ``fancy`` action of the
``Hello`` controller::
- // src/Acme/HelloBundle/Controller/HelloController.php
+ // src/AppBundle/Controller/HelloController.php
class HelloController extends Controller
{
@@ -273,7 +273,7 @@ Here, the ``AcmeHelloBundle:Hello:fancy`` string refers to the ``fancy`` action
// create some object, based on the $color variable
$object = ...;
- return $this->render('AcmeHelloBundle:Hello:fancy.html.php', array(
+ return $this->render('AppBundle:Hello:fancy.html.php', array(
'name' => $name,
'object' => $object
));
@@ -317,10 +317,10 @@ pattern:
.. code-block:: yaml
- # src/Acme/HelloBundle/Resources/config/routing.yml
+ # src/AppBundle/Resources/config/routing.yml
hello: # The route name
path: /hello/{name}
- defaults: { _controller: AcmeHelloBundle:Hello:index }
+ defaults: { _controller: AppBundle:Hello:index }
Using Assets: Images, JavaScripts and Stylesheets
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/cookbook/templating/namespaced_paths.rst b/cookbook/templating/namespaced_paths.rst
index e4ce2331f71..3cccde0bf10 100644
--- a/cookbook/templating/namespaced_paths.rst
+++ b/cookbook/templating/namespaced_paths.rst
@@ -17,15 +17,15 @@ Take the following paths as an example:
.. code-block:: jinja
- {% extends "AcmeDemoBundle::layout.html.twig" %}
- {% include "AcmeDemoBundle:Foo:bar.html.twig" %}
+ {% extends "AppBundle::layout.html.twig" %}
+ {% include "AppBundle:Foo:bar.html.twig" %}
With namespaced paths, the following works as well:
.. code-block:: jinja
- {% extends "@AcmeDemo/layout.html.twig" %}
- {% include "@AcmeDemo/Foo/bar.html.twig" %}
+ {% extends "@App/layout.html.twig" %}
+ {% include "@App/Foo/bar.html.twig" %}
Both paths are valid and functional by default in Symfony.
diff --git a/cookbook/templating/render_without_controller.rst b/cookbook/templating/render_without_controller.rst
index 004a8816a55..e59506896b0 100644
--- a/cookbook/templating/render_without_controller.rst
+++ b/cookbook/templating/render_without_controller.rst
@@ -10,7 +10,7 @@ a simple template that doesn't need any data passed into it, you can avoid
creating the controller entirely, by using the built-in ``FrameworkBundle:Template:template``
controller.
-For example, suppose you want to render a ``AcmeBundle:Static:privacy.html.twig``
+For example, suppose you want to render a ``AppBundle:Static:privacy.html.twig``
template, which doesn't require that any variables are passed to it. You
can do this without creating a controller:
@@ -22,7 +22,7 @@ can do this without creating a controller:
path: /privacy
defaults:
_controller: FrameworkBundle:Template:template
- template: 'AcmeBundle:Static:privacy.html.twig'
+ template: 'AppBundle:Static:privacy.html.twig'
.. code-block:: xml
@@ -34,7 +34,7 @@ can do this without creating a controller:
FrameworkBundle:Template:template
- AcmeBundle:Static:privacy.html.twig
+ AppBundle:Static:privacy.html.twig
@@ -46,7 +46,7 @@ can do this without creating a controller:
$collection = new RouteCollection();
$collection->add('acme_privacy', new Route('/privacy', array(
'_controller' => 'FrameworkBundle:Template:template',
- 'template' => 'AcmeBundle:Static:privacy.html.twig',
+ 'template' => 'AppBundle:Static:privacy.html.twig',
)));
return $collection;
@@ -93,7 +93,7 @@ other variables in your route, you can control exactly how your page is cached:
path: /privacy
defaults:
_controller: FrameworkBundle:Template:template
- template: 'AcmeBundle:Static:privacy.html.twig'
+ template: 'AppBundle:Static:privacy.html.twig'
maxAge: 86400
sharedAge: 86400
@@ -107,7 +107,7 @@ other variables in your route, you can control exactly how your page is cached:
FrameworkBundle:Template:template
- AcmeBundle:Static:privacy.html.twig
+ AppBundle:Static:privacy.html.twig
86400
86400
@@ -121,7 +121,7 @@ other variables in your route, you can control exactly how your page is cached:
$collection = new RouteCollection();
$collection->add('acme_privacy', new Route('/privacy', array(
'_controller' => 'FrameworkBundle:Template:template',
- 'template' => 'AcmeBundle:Static:privacy.html.twig',
+ 'template' => 'AppBundle:Static:privacy.html.twig',
'maxAge' => 86400,
'sharedAge' => 86400,
)));
diff --git a/cookbook/templating/twig_extension.rst b/cookbook/templating/twig_extension.rst
index 1931e52d23e..993a9fa73d4 100644
--- a/cookbook/templating/twig_extension.rst
+++ b/cookbook/templating/twig_extension.rst
@@ -30,10 +30,10 @@ Create the Extension Class
To get your custom functionality you must first create a Twig Extension class.
As an example you'll create a price filter to format a given number into price::
- // src/Acme/DemoBundle/Twig/AcmeExtension.php
- namespace Acme\DemoBundle\Twig;
+ // src/AppBundle/Twig/AppExtension.php
+ namespace AppBundle\Twig;
- class AcmeExtension extends \Twig_Extension
+ class AppExtension extends \Twig_Extension
{
public function getFilters()
{
@@ -52,7 +52,7 @@ As an example you'll create a price filter to format a given number into price::
public function getName()
{
- return 'acme_extension';
+ return 'app_extension';
}
}
@@ -70,29 +70,29 @@ Now you must let the Service Container know about your newly created Twig Extens
.. code-block:: yaml
- # src/Acme/DemoBundle/Resources/config/services.yml
+ # app/config/services.yml
services:
- acme.twig.acme_extension:
- class: Acme\DemoBundle\Twig\AcmeExtension
+ app.twig_extension:
+ class: AppBundle\Twig\AcmeExtension
tags:
- { name: twig.extension }
.. code-block:: xml
-
+
-
+
.. code-block:: php
- // src/Acme/DemoBundle/Resources/config/services.php
+ // app/config/services.php
use Symfony\Component\DependencyInjection\Definition;
$container
- ->register('acme.twig.acme_extension', '\Acme\DemoBundle\Twig\AcmeExtension')
+ ->register('app.twig_extension', '\AppBundle\Twig\AcmeExtension')
->addTag('twig.extension');
.. note::
diff --git a/cookbook/testing/database.rst b/cookbook/testing/database.rst
index bd73d70b889..5a8709ac3db 100644
--- a/cookbook/testing/database.rst
+++ b/cookbook/testing/database.rst
@@ -33,7 +33,7 @@ class.
Suppose the class you want to test looks like this::
- namespace Acme\DemoBundle\Salary;
+ namespace AppBundle\Salary;
use Doctrine\Common\Persistence\ObjectManager;
@@ -48,7 +48,7 @@ Suppose the class you want to test looks like this::
public function calculateTotalSalary($id)
{
- $employeeRepository = $this->entityManager->getRepository('AcmeDemoBundle::Employee');
+ $employeeRepository = $this->entityManager->getRepository('AppBundle::Employee');
$employee = $employeeRepository->find($id);
return $employee->getSalary() + $employee->getBonus();
@@ -58,14 +58,14 @@ Suppose the class you want to test looks like this::
Since the ``ObjectManager`` gets injected into the class through the constructor,
it's easy to pass a mock object within a test::
- use Acme\DemoBundle\Salary\SalaryCalculator;
+ use AppBundle\Salary\SalaryCalculator;
class SalaryCalculatorTest extends \PHPUnit_Framework_TestCase
{
public function testCalculateTotalSalary()
{
// First, mock the object to be used in the test
- $employee = $this->getMock('\Acme\DemoBundle\Entity\Employee');
+ $employee = $this->getMock('\AppBundle\Entity\Employee');
$employee->expects($this->once())
->method('getSalary')
->will($this->returnValue(1000));
diff --git a/cookbook/testing/simulating_authentication.rst b/cookbook/testing/simulating_authentication.rst
index 9004fe0832a..f2e04acd612 100644
--- a/cookbook/testing/simulating_authentication.rst
+++ b/cookbook/testing/simulating_authentication.rst
@@ -15,14 +15,14 @@ Another way would be to create a token yourself and store it in a session.
While doing this, you have to make sure that an appropriate cookie is sent
with a request. The following example demonstrates this technique::
- // src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php
- namespace Acme\DemoBundle\Tests\Controller;
+ // src/AppBundle/Tests/Controller/DefaultControllerTest.php
+ namespace Appbundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
- class DemoControllerTest extends WebTestCase
+ class DefaultControllerTest extends WebTestCase
{
private $client = null;
@@ -35,10 +35,10 @@ with a request. The following example demonstrates this technique::
{
$this->logIn();
- $crawler = $this->client->request('GET', '/demo/secured/hello/Fabien');
+ $crawler = $this->client->request('GET', '/admin');
$this->assertTrue($this->client->getResponse()->isSuccessful());
- $this->assertGreaterThan(0, $crawler->filter('html:contains("Hello Fabien")')->count());
+ $this->assertGreaterThan(0, $crawler->filter('html:contains("Admin Dashboard")')->count());
}
private function logIn()
diff --git a/cookbook/validation/custom_constraint.rst b/cookbook/validation/custom_constraint.rst
index 5cfd2312759..0220d858f8a 100644
--- a/cookbook/validation/custom_constraint.rst
+++ b/cookbook/validation/custom_constraint.rst
@@ -14,8 +14,8 @@ Creating the Constraint Class
First you need to create a Constraint class and extend :class:`Symfony\\Component\\Validator\\Constraint`::
- // src/Acme/DemoBundle/Validator/Constraints/ContainsAlphanumeric.php
- namespace Acme\DemoBundle\Validator\Constraints;
+ // src/AppBundle/Validator/Constraints/ContainsAlphanumeric.php
+ namespace AppBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
@@ -54,8 +54,8 @@ when actually performing the validation.
The validator class is also simple, and only has one required method ``validate()``::
- // src/Acme/DemoBundle/Validator/Constraints/ContainsAlphanumericValidator.php
- namespace Acme\DemoBundle\Validator\Constraints;
+ // src/AppBundle/Validator/Constraints/ContainsAlphanumericValidator.php
+ namespace AppBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
@@ -91,18 +91,18 @@ Using custom validators is very easy, just as the ones provided by Symfony itsel
.. code-block:: yaml
- # src/Acme/BlogBundle/Resources/config/validation.yml
- Acme\DemoBundle\Entity\AcmeEntity:
+ # src/AppBundle/Resources/config/validation.yml
+ AppBundle\Entity\AcmeEntity:
properties:
name:
- NotBlank: ~
- - Acme\DemoBundle\Validator\Constraints\ContainsAlphanumeric: ~
+ - AppBundle\Validator\Constraints\ContainsAlphanumeric: ~
.. code-block:: php-annotations
- // src/Acme/DemoBundle/Entity/AcmeEntity.php
+ // src/AppBundle/Entity/AcmeEntity.php
use Symfony\Component\Validator\Constraints as Assert;
- use Acme\DemoBundle\Validator\Constraints as AcmeAssert;
+ use AppBundle\Validator\Constraints as AcmeAssert;
class AcmeEntity
{
@@ -119,26 +119,26 @@ Using custom validators is very easy, just as the ones provided by Symfony itsel
.. code-block:: xml
-
+
-
+
-
+
.. code-block:: php
- // src/Acme/DemoBundle/Entity/AcmeEntity.php
+ // src/AppBundle/Entity/AcmeEntity.php
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\NotBlank;
- use Acme\DemoBundle\Validator\Constraints\ContainsAlphanumeric;
+ use AppBundle\Validator\Constraints\ContainsAlphanumeric;
class AcmeEntity
{
@@ -167,6 +167,7 @@ tag and an ``alias`` attribute:
.. code-block:: yaml
+ # app/config/services.yml
services:
validator.unique.your_validator_name:
class: Fully\Qualified\Validator\Class\Name
@@ -175,6 +176,7 @@ tag and an ``alias`` attribute:
.. code-block:: xml
+
@@ -182,6 +184,7 @@ tag and an ``alias`` attribute:
.. code-block:: php
+ // app/config/services.php
$container
->register('validator.unique.your_validator_name', 'Fully\Qualified\Validator\Class\Name')
->addTag('validator.constraint_validator', array('alias' => 'alias_name'));
@@ -236,10 +239,10 @@ not to the property:
.. code-block:: yaml
- # src/Acme/BlogBundle/Resources/config/validation.yml
- Acme\DemoBundle\Entity\AcmeEntity:
+ # src/AppBundle/Resources/config/validation.yml
+ AppBundle\Entity\AcmeEntity:
constraints:
- - Acme\DemoBundle\Validator\Constraints\ContainsAlphanumeric: ~
+ - AppBundle\Validator\Constraints\ContainsAlphanumeric: ~
.. code-block:: php-annotations
@@ -253,7 +256,7 @@ not to the property:
.. code-block:: xml
-
-
-
+
+
+
diff --git a/cookbook/web_services/php_soap_extension.rst b/cookbook/web_services/php_soap_extension.rst
index f01516f61c2..49ec8c323b1 100644
--- a/cookbook/web_services/php_soap_extension.rst
+++ b/cookbook/web_services/php_soap_extension.rst
@@ -59,7 +59,7 @@ a ``HelloService`` object properly:
.. code-block:: yaml
- # app/config/config.yml
+ # app/config/services.yml
services:
hello_service:
class: Acme\SoapBundle\Services\HelloService
@@ -67,7 +67,7 @@ a ``HelloService`` object properly:
.. code-block:: xml
-
+
@@ -76,7 +76,7 @@ a ``HelloService`` object properly:
.. code-block:: php
- // app/config/config.php
+ // app/config/services.php
$container
->register('hello_service', 'Acme\SoapBundle\Services\HelloService')
->addArgument(new Reference('mailer'));
@@ -190,7 +190,7 @@ An example WSDL is below.
-.. _`PHP SOAP`: http://php.net/manual/en/book.soap.php
-.. _`NuSOAP`: http://sourceforge.net/projects/nusoap
-.. _`output buffering`: http://php.net/manual/en/book.outcontrol.php
-.. _`Zend SOAP`: http://framework.zend.com/manual/en/zend.soap.server.html
+.. _`PHP SOAP`: http://php.net/manual/en/book.soap.php
+.. _`NuSOAP`: http://sourceforge.net/projects/nusoap
+.. _`output buffering`: http://php.net/manual/en/book.outcontrol.php
+.. _`Zend SOAP`: http://framework.zend.com/manual/en/zend.soap.server.html
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy