Originally published at: http://www.sitepoint.com/symfony2-console-getting-started-console-helpers/
Lately, I’ve been spending a significant amount of time working with the Symfony 2 Console Component in order to process different tasks, especially cronjobs. In this tutorial, I’ll share my experiences and we’ll give some extra love to the console helpers, which provide us with a large collection of handy functions. There are a lot of reasons to create console commands in your projects: sending emails, exporting/importing data, creating users, and so on.
Introduction
First, I recommend that you read this SitePoint article by Daniel Gafitescu. He explains how to get started with the Symfony 2 Console Component with a simple example: generate all Fibonacci numbers between two given integers. Daniel also introduces essential concepts that we won’t go through today, so I highly suggest you have a look before moving on.
By the end of this post, we want to be able to create a basic console command to generate some output – any output will do – only the way to getting there is important. Near the end, we’ll discover some console helpers in order to create some nice interactions between users and the interface.
Continue reading this article on SitePoint