Skip to content

Commit

Permalink
minor #4868 Remove horizontal scrollbar (ifdattic)
Browse files Browse the repository at this point in the history
This PR was submitted for the 2.4 branch but it was merged into the 2.6 branch instead (closes #4868).

Discussion
----------

Remove horizontal scrollbar

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

Commits
-------

bed19da Remove horizontal scrollbar
  • Loading branch information
weaverryan committed Apr 27, 2015
2 parents c166fdf + bed19da commit 0b7f89b
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions cookbook/console/commands_as_services.rst
Expand Up @@ -38,11 +38,13 @@ with ``console.command``:
<?xml version="1.0" encoding="UTF-8" ?>
<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">
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd">
<services>
<service id="acme_hello.command.my_command"
class="Acme\HelloBundle\Command\MyCommand">
<tag name="console.command" />
</service>
</services>
Expand All @@ -52,7 +54,10 @@ with ``console.command``:
// app/config/config.php
$container
->register('acme_hello.command.my_command', 'Acme\HelloBundle\Command\MyCommand')
->register(
'acme_hello.command.my_command',
'Acme\HelloBundle\Command\MyCommand'
)
->addTag('console.command')
;
Expand All @@ -63,7 +68,7 @@ Imagine you want to provide a default value for the ``name`` option. You could
pass one of the following as the 5th argument of ``addOption()``:

* a hardcoded string;
* a container parameter (e.g. something from parameters.yml);
* a container parameter (e.g. something from ``parameters.yml``);
* a value computed by a service (e.g. a repository).

By extending ``ContainerAwareCommand``, only the first is possible, because you
Expand Down Expand Up @@ -98,7 +103,13 @@ have some ``NameRepository`` service that you'll use to get your default value::
$this
->setName('demo:greet')
->setDescription('Greet someone')
->addOption('name', '-n', InputOption::VALUE_REQUIRED, 'Who do you want to greet?', $defaultName)
->addOption(
'name',
'-n',
InputOption::VALUE_REQUIRED,
'Who do you want to greet?',
$defaultName
)
;
}

Expand Down

0 comments on commit 0b7f89b

Please sign in to comment.