Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/en/console-commands/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class HelloCommand extends Command
```

Command classes must implement an `execute()` method that does the bulk of
their work. This method is called when a command is invoked. Let's call our first
command application directory, run:
their work. This method is called when a command is invoked. Let's call our
first command. From your application directory, run:

```bash
bin/cake hello
Expand All @@ -48,6 +48,16 @@ You should see the following output:

Hello world.

::: info
The `Arguments` and `ConsoleIo` instances passed to `execute()` are also
available on the command instance as `$this->args` and `$this->io`.
In 6.x, the `execute()` method signature will drop these arguments
and `$this->args` / `$this->io` will be the only way to access
these objects. See the
[6.x command refactor](https://github.com/cakephp/cakephp/pull/18983) for
details.
:::

Our `execute()` method isn't very interesting let's read some input from the
command line:

Expand Down