From c3e2be23e491e50634872be049f30467bc002bdd Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Wed, 31 Dec 2014 14:58:48 +0200 Subject: [PATCH 1/2] Improve readability | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/page_creation.rst | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/book/page_creation.rst b/book/page_creation.rst index 32fd6cf5154..63c1dc65ae4 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -122,7 +122,7 @@ the bundle is registered with the kernel:: public function registerBundles() { $bundles = array( - ..., + // ... new Acme\DemoBundle\AcmeDemoBundle(), ); // ... @@ -282,7 +282,11 @@ route is matched:: { public function indexAction($limit) { - return new Response('Number: '.rand(1, $limit).''); + return new Response( + 'Number: ' + .rand(1, $limit) + .'' + ); } } @@ -420,7 +424,7 @@ Step through the Twig template line-by-line: The parent template, ``::base.html.twig``, is missing both the **BundleName** and **ControllerName** portions of its name (hence the double colon (``::``) -at the beginning). This means that the template lives outside of the bundles +at the beginning). This means that the template lives outside of the bundle and in the ``app`` directory: .. configuration-block:: @@ -451,7 +455,8 @@ and in the ``app`` directory: <?php $view['slots']->output('title', 'Welcome!') ?> output('stylesheets') ?> - + output('_content') ?> @@ -718,8 +723,8 @@ Now that you've created the bundle, enable it via the ``AppKernel`` class:: public function registerBundles() { $bundles = array( - ..., - // register your bundles + // ... + // register your bundle new Acme\TestBundle\AcmeTestBundle(), ); // ... @@ -824,9 +829,12 @@ format you prefer: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:framework="http://symfony.com/schema/dic/symfony" xmlns:twig="http://symfony.com/schema/dic/twig" - xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd - http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd - http://symfony.com/schema/dic/twig http://symfony.com/schema/dic/twig/twig-1.0.xsd"> + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd + http://symfony.com/schema/dic/twig + http://symfony.com/schema/dic/twig/twig-1.0.xsd"> @@ -1017,8 +1025,10 @@ the configuration file for the ``dev`` environment. + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -1038,7 +1048,7 @@ the configuration file for the ``dev`` environment. $loader->import('config.php'); $container->loadFromExtension('framework', array( - 'router' => array( + 'router' => array( 'resource' => '%kernel.root_dir%/config/routing_dev.php', ), 'profiler' => array('only-exceptions' => false), From ccc67d8dea8172ad553184b130efcd4cd29101bb Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Wed, 31 Dec 2014 17:15:45 +0200 Subject: [PATCH 2/2] Update page_creation.rst --- book/page_creation.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/book/page_creation.rst b/book/page_creation.rst index 63c1dc65ae4..ac23536b46c 100644 --- a/book/page_creation.rst +++ b/book/page_creation.rst @@ -283,9 +283,7 @@ route is matched:: public function indexAction($limit) { return new Response( - 'Number: ' - .rand(1, $limit) - .'' + 'Number: '.rand(1, $limit).'' ); } }