From the course: Symfony 6 Essential Training

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Console

Console

- [Instructor] This is one of my favorite features of the Symphony Project. If you've been following along in this course, you have seen the Symphony Console in action as part of the Symphony CLI. In fact, that's where I'm going to start. I can run Symphony Console, make a command. Like usual, Symphony prompts us for the work. The command name suggests using a category in this case app, a colon, and then the command. So let's do tool, coin flip, and that's it, our command exists. And here it is. In typical Symphony fashion, the class starts with annotations plus the name and description we can update. Note that this class extends command. There are two methods. The first is configure. I'll be using the add argument first. Arguments are positional and can be required or optional. Also, notice the description. Next is the option. This is a flag and can be required or optional. Further, it can be a simple Boolean…

Contents