Skip to content

Commit

Permalink
minor #4722 Improve readability (ifdattic)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.3 branch (closes #4722).

Discussion
----------

Improve readability

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.3
| Fixed tickets |

1. I personally find `// ...` much more understandable and less troublesome when hiding code from examples

2. Remove horizontal scrolling

3. Some small changes

Commits
-------

6cd1a1d Improve readability
  • Loading branch information
wouterj committed Jan 2, 2015
2 parents dcc9516 + 6cd1a1d commit ece2c81
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions book/page_creation.rst
Expand Up @@ -122,7 +122,7 @@ the bundle is registered with the kernel::
public function registerBundles()
{
$bundles = array(
...,
// ...
new Acme\DemoBundle\AcmeDemoBundle(),
);
// ...
Expand Down Expand Up @@ -282,7 +282,9 @@ route is matched::
{
public function indexAction($limit)
{
return new Response('<html><body>Number: '.rand(1, $limit).'</body></html>');
return new Response(
'<html><body>Number: '.rand(1, $limit).'</body></html>'
);
}
}

Expand Down Expand Up @@ -420,7 +422,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::
Expand Down Expand Up @@ -451,7 +453,8 @@ and in the ``app`` directory:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php $view['slots']->output('title', 'Welcome!') ?></title>
<?php $view['slots']->output('stylesheets') ?>
<link rel="shortcut icon" href="<?php echo $view['assets']->getUrl('favicon.ico') ?>" />
<link rel="shortcut icon"
href="<?php echo $view['assets']->getUrl('favicon.ico') ?>" />
</head>
<body>
<?php $view['slots']->output('_content') ?>
Expand Down Expand Up @@ -718,8 +721,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(),
);
// ...
Expand Down Expand Up @@ -824,9 +827,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">
<imports>
<import resource="parameters.yml" />
Expand Down Expand Up @@ -1017,8 +1023,10 @@ the configuration file for the ``dev`` environment.
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
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">
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">
<imports>
<import resource="config.xml" />
Expand All @@ -1038,7 +1046,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),
Expand Down

0 comments on commit ece2c81

Please sign in to comment.