Available for new consulting projects — Get in touch

CakePHP Plugins

Motivation

This paper is intended to try to improve the next version of Cake. I think one of the most important features of a framework is its capacity to be expanded. Plugins achieve that gracefully. But there is a problem; plugins, as read on tempdocs, are meant to be packages. I think they can be much more. This is mainly a software design problem.

Where they fail

Point #1

Cake creates conventions for everything turning controllers, models and views universal. Same happens to plugins, but because of namespace concerns it is recommended to developers to include plugins name in controllers, models and views names. So a blog plugin would have BlogPost and BlogComment as models, BlogPosts and BlogComments as controllers. That’s fine to me (and recommended) but the Router should be smart so it won’t be necessary URI’s like /blog/blogPosts.

Read more →

Charts in jQuery

Introducing Flotr, a new plugin for jQuery that will simplify adding charts to your pages. Unlike the Google Chart API, this plugin creates and manipulates charts on the fly.

This plugin was born from the author’s frustration, Ole Laursen, since other plugins weren’t smart enough. The advantage of this plugin over others is that it automatically adjusts the limits and scales according to the input values. An equivalent plugin, but for Prototype, is Plotr. This competition between Prototype and jQuery only benefits users.

Read more →

Magic Objects

Today I’m going to present a function that most of the PHP community doesn’t know about. It falls under the “magic functions”, was included in PHP5, but needs to be defined.

In medium-scale projects where we have more than a few files, it’s almost certain that we’ll be using classes and including them from external files.

<br></br><br></br>

This is a typical example of a simple/complex application. We include our file on every page where we’ll need a database connection and on each of them we instantiate our object.

Read more →

Google Reader Theme

John Hicks, a famous English designer, released a skin for Google Reader a few weeks ago. Installation requires just a few simple steps and it’s compatible with any browser (except IE).

Screenshots

Installation

Download gReader.zip. There are two versions, one for Mozilla browsers and one for WebKit & Opera.

Firefox

After installing the [Stylish](https://addons.mozilla.org/en-US/firefox/addon/2108) extension, paste the contents of the CSS file into '_create styles for this page_'. Click the new icon that will appear in the statusbar.

Camino

Read more →

Beginners' Guide

This area is intended for everyone new to PHP. It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire. These tutorials build on a previously-published 5-part series which has now been updated and extended to embrace PHP 5, making parts of it suitable for those of you who already have worked with PHP 4 in the past.

If you came here to learn about elementary PHP 4 or basic PHP 5, this is for you. Enjoy!

Read more →

PHP Console

Have you ever wondered if it would be possible to execute PHP files from the command line, just like C or Pascal programs?

Besides being kind of fun, you’ve probably actually needed to do this at some point and didn’t know how. Imagine a PHP file that would run when the server started (or your locally installed server) and would take care of deleting old forum messages or updating the statistics of a file manager.

Read more →