@@ -15,8 +15,8 @@ The simple User Model
1515
1616You have a simple ``User `` entity mapped to the database::
1717
18- // src/Acme/AccountBundle /Entity/User.php
19- namespace Acme\AccountBundle \Entity;
18+ // src/AppBundle /Entity/User.php
19+ namespace AppBundle \Entity;
2020
2121 use Doctrine\ORM\Mapping as ORM;
2222 use Symfony\Component\Validator\Constraints as Assert;
@@ -106,8 +106,8 @@ Create a Form for the Model
106106
107107Next, create the form for the ``User `` model::
108108
109- // src/Acme/AccountBundle /Form/Type/UserType.php
110- namespace Acme\AccountBundle \Form\Type;
109+ // src/AppBundle /Form/Type/UserType.php
110+ namespace AppBundle \Form\Type;
111111
112112 use Symfony\Component\Form\AbstractType;
113113 use Symfony\Component\Form\FormBuilderInterface;
@@ -128,7 +128,7 @@ Next, create the form for the ``User`` model::
128128 public function setDefaultOptions(OptionsResolverInterface $resolver)
129129 {
130130 $resolver->setDefaults(array(
131- 'data_class' => 'Acme\AccountBundle \Entity\User'
131+ 'data_class' => 'AppBundle \Entity\User'
132132 ));
133133 }
134134
@@ -156,17 +156,17 @@ be stored in the database.
156156
157157Start by creating a simple class which represents the "registration"::
158158
159- // src/Acme/AccountBundle /Form/Model/Registration.php
160- namespace Acme\AccountBundle \Form\Model;
159+ // src/AppBundle /Form/Model/Registration.php
160+ namespace AppBundle \Form\Model;
161161
162162 use Symfony\Component\Validator\Constraints as Assert;
163163
164- use Acme\AccountBundle \Entity\User;
164+ use AppBundle \Entity\User;
165165
166166 class Registration
167167 {
168168 /**
169- * @Assert\Type(type="Acme\AccountBundle \Entity\User")
169+ * @Assert\Type(type="AppBundle \Entity\User")
170170 * @Assert\Valid()
171171 */
172172 protected $user;
@@ -200,8 +200,8 @@ Start by creating a simple class which represents the "registration"::
200200
201201Next, create the form for this ``Registration `` model::
202202
203- // src/Acme/AccountBundle /Form/Type/RegistrationType.php
204- namespace Acme\AccountBundle \Form\Type;
203+ // src/AppBundle /Form/Type/RegistrationType.php
204+ namespace AppBundle \Form\Type;
205205
206206 use Symfony\Component\Form\AbstractType;
207207 use Symfony\Component\Form\FormBuilderInterface;
@@ -236,13 +236,13 @@ Handling the Form Submission
236236Next, you need a controller to handle the form. Start by creating a simple
237237controller for displaying the registration form::
238238
239- // src/Acme/AccountBundle /Controller/AccountController.php
240- namespace Acme\AccountBundle \Controller;
239+ // src/AppBundle /Controller/AccountController.php
240+ namespace AppBundle \Controller;
241241
242242 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
243243
244- use Acme\AccountBundle \Form\Type\RegistrationType;
245- use Acme\AccountBundle \Form\Model\Registration;
244+ use AppBundle \Form\Type\RegistrationType;
245+ use AppBundle \Form\Model\Registration;
246246
247247 class AccountController extends Controller
248248 {
@@ -254,7 +254,7 @@ controller for displaying the registration form::
254254 ));
255255
256256 return $this->render(
257- 'AcmeAccountBundle :Account:register.html.twig',
257+ 'AppBundle :Account:register.html.twig',
258258 array('form' => $form->createView())
259259 );
260260 }
@@ -264,7 +264,7 @@ And its template:
264264
265265.. code-block :: html+jinja
266266
267- {# src/Acme/AccountBundle /Resources/views/Account/register.html.twig #}
267+ {# src/AppBundle /Resources/views/Account/register.html.twig #}
268268 {{ form(form) }}
269269
270270Next, create the controller which handles the form submission. This performs
@@ -291,7 +291,7 @@ the validation and saves the data into the database::
291291 }
292292
293293 return $this->render(
294- 'AcmeAccountBundle :Account:register.html.twig',
294+ 'AppBundle :Account:register.html.twig',
295295 array('form' => $form->createView())
296296 );
297297 }
@@ -307,44 +307,44 @@ Next, update your routes. If you're placing your routes inside your bundle
307307
308308 .. code-block :: yaml
309309
310- # src/Acme/AccountBundle /Resources/config/routing.yml
310+ # src/AppBundle /Resources/config/routing.yml
311311 account_register :
312312 path : /register
313- defaults : { _controller: AcmeAccountBundle :Account:register }
313+ defaults : { _controller: AppBundle :Account:register }
314314
315315 account_create :
316316 path : /register/create
317- defaults : { _controller: AcmeAccountBundle :Account:create }
317+ defaults : { _controller: AppBundle :Account:create }
318318
319319 .. code-block :: xml
320320
321- <!-- src/Acme/AccountBundle /Resources/config/routing.xml -->
321+ <!-- src/AppBundle /Resources/config/routing.xml -->
322322 <?xml version =" 1.0" encoding =" UTF-8" ?>
323323 <routes xmlns =" http://symfony.com/schema/routing"
324324 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
325325 xsi : schemaLocation =" http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd" >
326326
327327 <route id =" account_register" path =" /register" >
328- <default key =" _controller" >AcmeAccountBundle :Account:register</default >
328+ <default key =" _controller" >AppBundle :Account:register</default >
329329 </route >
330330
331331 <route id =" account_create" path =" /register/create" >
332- <default key =" _controller" >AcmeAccountBundle :Account:create</default >
332+ <default key =" _controller" >AppBundle :Account:create</default >
333333 </route >
334334 </routes >
335335
336336 .. code-block :: php
337337
338- // src/Acme/AccountBundle /Resources/config/routing.php
338+ // src/AppBundle /Resources/config/routing.php
339339 use Symfony\Component\Routing\RouteCollection;
340340 use Symfony\Component\Routing\Route;
341341
342342 $collection = new RouteCollection();
343343 $collection->add('account_register', new Route('/register', array(
344- '_controller' => 'AcmeAccountBundle :Account:register',
344+ '_controller' => 'AppBundle :Account:register',
345345 )));
346346 $collection->add('account_create', new Route('/register/create', array(
347- '_controller' => 'AcmeAccountBundle :Account:create',
347+ '_controller' => 'AppBundle :Account:create',
348348 )));
349349
350350 return $collection;
0 commit comments