Built-in console commands
Now that we know how to run console commands, let's take a look at the built-in commands to see how they work. As shown previously, Yii2 has seven built-in console commands: help
, asset
, cache
, fixtures
, gii
, message
, and migrate
. During the development of our application, we're likely to use all seven in order to make our application more robust. Let's take a look at each one in more detail.
The help command
The first command built in to Yii2 is the help
command. Often when running console commands, you may not know what options a certain command needs. Rather than referencing the Yii2 documentation, you can use the help
command to provide you with all the core information you need.
At the most basic level, the help
command will output all the currently available console commands:
$ ./yii help
Some commands contain additional subcommands that can be run. To view a list of all the available subcommands for a given command, you can run this:
$ ./yii help...