Posts By: Mikael Ohlsson

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 »

Symfony2 and Translatable example

To set up translatable have a look at my previous post: Symfony2 and DoctrineExtensions. First lets have a look at the translatable settings from the previous post // app/config/config.yml … # Doctrine Extensions Configuration stof_doctrine_extensions: default_locale: en_us translation_fallback: true orm: default: timestampable: true translatable: true The settings above tells that we want to use en_us… Read more »