Sorting By Custom Column in the Symfony Admin Generator


Did you ever wish you could sort by a partial column in the admin generator? Using DbFinder and a few lines of code, it is now possible.

The symfony admin generator allows you to select which properties of a model you want to display. You can include foreign key fields, or even a partial field to display pretty much everything you want in the list view. The following example uses this ability to display the name of article authors, based on the fact that the Article model has a many to one relationship to the User model:

http://redotheweb.com/2008/09/25/sorting-by-custom-column-in-the-symfony-admin-generator/

  1. No comments yet.
(will not be published)