Dyce & Sons Ltd.

Helping IT since 1993

Revisiting jQuery & PHP Sites

Friday 16th August, 2013

I recently embarked on a small project using meteor.js. It’s a great little platform, but not as mature as it’s made out. Having mocked up the UI for the client in Bootstrap (and got some way with the implementation), I discovered the fly in the ointment.

For a web-app building environment, the fact that it’s tied into MongoDB (and in fact, minimongo on the client side), makes it easy to ceate reactive, javascript friendly, client & server code. It also means there’s currently quite a large hole in the side of the ship. MongoDB only recently (v2.4) added full-text search. And meteor.js doesn’t yet have a canonical implementation method. It was time to don the rubber gloves, and dive back in to a more traditional PHP/MySQL implementation.

Roll-your Own Framework

The client’s spec really is quite modest, and wouldn’t benefit from the weight of a full blown framework (hence the attractiveness of meteor.js in the first place). So instead, I’ve written a small, hopefully clean, little framework that will get the job turned around sharpish.

Things have moved on a great deal since the last time I wrote a framework from scratch. In essence, the framework is designed to provide clean urls, a modular construction, and a simple authentication system against an easily deployable LAMP stack.

The technologies follows a pretty straightforward recipe. An Apache .htaccess file to limit user interaction to just one client-facing index.php file, a redirection function for parsing down the urls into object->verb type pairs, a simple CRUD class to make the management PDO statements slightly easier, and a hint of jQuery to sweeten the interface. There’s also a soup‚àö√üon of php object in there for simplifying the paginated tables of results.

Once it’s all working and I have an happy client, I will try to release Yet Another LAMP Framework onto an uninterested world!