Five months with Symfony 2

Hi folks,

Well, today I am going to briefly discuss on couple of things which I have learned throughout my journey in Symfony 2.  Well the journey is still ongoing and this brief discussion is about first couple of months, in exact terms first five months.

At very beginning, as an experienced CodeIgnitor and CakePHP developer, I found that Symfony 2 is quite confusing for me. The bundle concept started to bring some nightmares on me. The ‘bundle’ concept is a whole new experience for a developer who is sound with PHP frameworks such as CodeIgnitor and CakePHP. But today I found that, I am so lucky to get my self around with ‘bundles’, which makes developers life very straightforward and easy. I honestly believe Symfony 2, SensioLabs, Fabien did the correct thing by introducing ‘bundles’ for Symfony 2 which was not there for Symfony 1.x versions. Bundles let you organise your features, functions within your project in most efficient manner. The knowledge of arranging your projects according to functions, features within bundles will come to you once you spend sometime playing with Symfony 2. Then you come to a point, you get a feeling that how the things should get arranged in terms of Symfony 2, bundles point of view. So try your self by playing with Symfony 2, creating bundles under various vendors, etc, try your self how the bundle is created.

Continue reading

Share

Filter goes off when paginated CakePHP (1.3)

Hi CakePHP bakers,

Have you ever came across with a situation where searched filtering goes off (breaks) when you paginated through pages in your web app which was built using CakePHP 1.3 ? Actually, recently, I got an opportunity to deal with a similar problem and it took me a considerable time to judge the root cause behind this problem. I believe, at least there are few people out there who are struggling to get rid from this same situation. So this post is for you people, bakers 🙂

Exact problem :- Assume you have a page, which you are supposed to do a search (Searching users in the db, who have the last name of ‘Silva’). After you perform the search, you will be taken to a page where you will see the filtered results (In this case people who have ‘Silva’ as their last name). (Normally results will be showing below the search criterias, so you will be redirected to the same page with filtered results).  According the SQL limit you have set in your controller, the results will be grouped and showed like in the image below. The problem is when you browse through page 2,3,4 and so on from the pagination links, all your search criterias will go off and results will appear as there was no filter has defined. So in other words you will never be able to access the filtered results except first page. I hope the problem is crystal clear. (Please keep in mind that there is Ajax filtering and pagination available in CakePHP and I am not focussing on that direction)

Continue reading

Share