Posts Tagged: Symfony2

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 »

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 »

Enable Twig Extentions in Symfony2

Twig extentions is included by default in the vendors but to enable one of them like the Text (to be able to use nl2br) add the following to your app/config/config.yml services: twig.extension.txt: class: Twig_Extensions_Extension_Text tags: – { name: twig.extension }

Virtual Host and Symfony2

It is always good to set up a virtual host for your project when you are developing an application. Here is an example of two virtual hosts that I have set up for two of my projects. One called crm and one called blog and both projects are located under /Users/sfprojects/ This is what I… Read more »