Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 929e54f

Browse files
Added creating a file to run the Application/Commands
1 parent 22c88f1 commit 929e54f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

components/console.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,22 @@ add the following to it::
6868
}
6969
}
7070

71+
You also need to create the file to run at the command line which creates
72+
an ``Application`` and adds commands to it:
73+
74+
.. code-block::php
75+
76+
#!/usr/bin/env php
77+
# app/console
78+
<?php
79+
80+
use Acme\DemoBundle\Command\GreetCommand;
81+
use Symfony\Component\Console\Application;
82+
83+
$application = new Application();
84+
$application->add(new GreetCommand);
85+
$application->run();
86+
7187
Test the new console command by running the following
7288

7389
.. code-block:: bash

0 commit comments

Comments
 (0)