Symfony CRUD Generator

Tue, Jul 14, 2009 One-minute read

The symfony CRUD generator is a very useful tool for speeding up your web development. When you need a list of items that you can list and edit, you are most likely building a standard CRUD (create-read-update-delete) interface. This is common functionality that is found in most applications. Since this is such a common task, it makes perfect sense that the symfony web framework has a tool to build it for you.

For example: Lets say your web application allow users to sign-up (surprise!) and you need a user management tool in the admin section to manage these users. To create this in symfony, you’d run the following:

./symfony propel:generate-crud admin user User

This assumes you have an admin application, and a User model file. With that one line, it will create a listing of all users with the ability to edit and delete them. It generates HTML and PHP code that you can modify to your requirements. Fantastic for less than a minute of work!