I was wondering whether I can paginate my results using the letters in the alphabet instead of numbers. Do you know any methods to accomplish su开发者_如何学Pythonch a task in Symfony 1.4? I'm using Doctrine and I fetch the paginated records from the database.
After some search, no such pagination seem to exist directly with Symfony/Doctrine ; you will have to create your own.
You will have to iterate through A to Z for links (usability improvement: adding links only on letters "containing" elements you are handling)
And end up by Model side, by doing something such as:
$q = Doctrine_Query::create()
->select('e.id')
->from('Element e')
->where('e.name LIKE ?', $letter.'%');
echo $q->getSqlQuery();
etc.
精彩评论