I love developing usable and rich web applications using the latest techniques available.

Cakephp router and prefixes

Cakephp has been supporting admin routes for a long time. It’s also possible to use custom prefixes next to your admin routes for extra flexibility. However you will probably face some problems when you start using prefix routes. I’ll show you how to handle some of them.
Read the full article

04/12/2008 at 1:24 pm — Comments (7)

MenuHelper renamed to NavigationHelper

I renamed my MenuHelper to NavigationHelper. Navigation just makes more sense then menu. I also improved to code to be more flexible.

The repository also has been renamed, get your clone at ‘git://github.com/Pagebakers/navigationhelper.git’.

Have fun

27/11/2008 at 2:21 pm — Comments (1)

MenuHelper for CakePHP

It’s been a while since the last activity on my blog, but I want to get back posting again. Here’s my first attempt :)

I just released my MenuHelper for CakePHP. It’s a really simple class, but it saves time.
It allows you to generate menu’s and single links, if a link is currently active it adds an ‘active’ class.

Usage:
Copy menu.php to your helpers directory, and enable the helper by adding it to the $helpers array.

Then in your view you can do things like this:

// Echo a list with links
echo $menu->menu(array(
    array('Home', array('controller' => 'pages', 'action' => 'display', 'home')),
    array('Another link to home', '/', array('class' => 'another-link-to-home'))
), array('id' => 'my-menu'));

// Or a single link
echo $menu->link('Home', '/');

You can find the source on GitHub:

http://github.com/Pagebakers/menuhelper/tree/master/

Have fun with it.

04/11/2008 at 5:46 pm — Comments (5)

Upgrade your WordPress!

I’ve been running a very old version of WordPress for a while (2.0.2 if I remember). But since a few months strange things began to happen.

My plugins were suddenly turned off, comments were being disabled on random posts, etc.. But last week it became even worse.. my entire template has been f*cked up(that’s why I’m running the default template right now) and alot of spam had been injected in my posts (hidden with display:none;). This finally woke me up and I’ve upgraded to 2.6 right away.

I suggest everyone running older versions of WordPress to upgrade as soon as possible because they’re really full of security issues/holes.

15/07/2008 at 11:09 am — Comments (0)

Using JSON in CakePHP 1.2

May 8th 2008 – Controller::$beforeFilter has been deprecated a while ago, i’ve updated the example using Controller::beforeFilter()

Almost an half year ago I created jsonComponent for CakePHP, since then it has been used by quite a few people including myself.

About 3 months ago I started developing with CakePHP 1.2, one of the projects I’m working on is Pagebakery. Pagebakery relies heavily on AJAX and JSON and it’s therefore a perfect opportunity to experiment with CakePHP’s new features.

One of those features is Router::parseExtensions(). ParseExtensions allows you to parse the extension in your request and let Cake select alternate layouts and views automatically.
Another feature I found is JavascriptHelper::object(), this method is also available in CakePHP 1.1 but I only stumbled on it recently. It’s build-in JSON support in CakePHP, we no longer need the jsonComponent!

I’m going to explain you how to setup CakePHP 1.2 to output JSON with help of Router::parseExtensions() and the JavascriptHelper::object() method.
Read the full article

05/06/2007 at 12:48 pm — Comments (53)
« Newer PostsOlder Posts »