Monthly Archives: September 2011

KnpPaginatorBundle with JQuery partial postback

This post continues the previous post Pagination in Symfony2 with KnpPaginatorBundle. First of all you should add JQuery to your twig template. I recommend that you do not download JQuery and put it in your assets, but instead include it in your header like this: That will save you some bandwith and there is a… Read more »

Pagination in Symfony2 with KnpPaginatorBundle

Pagination is always nice in an application. I found a great bundle called KnpPaginatorBundle that helps you with pagination and as an bonus we also get sorting. So as usual we need to add some bundles to our deps file: [Zend] git=git:// target=/Zend [knp-components] git= [KnpPaginatorBundle] git= target=/bundles/Knp/Bundle/PaginatorBundle As you can see the KnpPaginatorBundle uses… Read more »

Twig and empty date

Ran in to a small problem when I was programming today. I had an Entity Person that had a birthday that could be empty (if we did not know it). When it was displayed with twig an empty value was displayed with the current date. So to display an empty date with twig you have… Read more »