Multi-level menu in PHP – how to do it without killing yourself or the database in the process

Why don’t you take a look at this newer tutorial about creating a multi-level menu in PHP. It also has a Bootstrap Framework implementation 🙂

Well. It’s been a long time since I’ve written a post. I was busy learning Laravel… Currently, I am trying the framework by working on a CMS, and, again, I have arrived at the phase of menus. And by “menus”, I am refering to multi-level menus. In the past I have found ways to bypass this dilemma, but now my time allowed me to dive into it. Continue reading

Meet my Matches – a PHP CLI script meant to expedite Codeigniter development

matches-logoMaybe it’s too early to make the announcement, so I hope you will all be gentle with this script. I’m not saying this is THE SOLUTION to your needs, but if you use it, I sure hope that you will also help further its development with a pull request or maybe some advice. Continue reading

Codeigniter – Convert an array to object

I usually use the results that come from the models as objects (not as arrays). However, there are moments when I need to work with the results before sending them to the view. In this case, getting the results from the model as an array is preferable. But, when I send them to the view, I would like to work with objects. So now I need to convert the array into an object. Continue reading

How to use a “Cookbook” with Codeigniter

cookbookI was asked to do a review for Codeigniter 2 Cookbook, written by Rob Foster and published by Packt Publishing (to be honest, I actually asked to review the book to get it for free).

I haven’t managed to keep the promise of reviewing the book in due time, but suddenly I realised that every now and then I return to the book to uncover a new programming style that makes me say: “Ahaaa”. Continue reading

Forms? Keep the validation rules inside the model

As always, when talking about forms we also talk about validation. For a long time I’ve validated the forms inside the controllers because it is fast and simple – no more browsing between files.

But after a while you find yourself having a controller which is becoming more complex and bigger. So why not keep at least the validation rules somewhere else? Continue reading

Codeigniter: My MY_Model or “How not to repeat yourself”

Often times I find myself doing the same queries over and over again for each table used by an application. This is why I needed to create an “universal” model in order to avoid repetition. Codeigniter lets you do that by allowing you to create a “MY_Model” inside the core folder of your application. Continue reading