This is the website of Andy Carter a PHP and jQuery web developer in the Steel City. Working with CakePHP (and a bit of Textpattern and Drupal too).

Latest Entries

Sublime Text 3

Sublime Text has got to be one of the most popular text editors out there for coding. Although still in beta, Sublime Text 3 is a relatively stable and very usable. I’ve personally been successfully using it for over 2 years now both at work and at home. It’s sophisticated, lightweight and easy to use. It also works on all the major platforms: Windows, OSX and Linux.

Sublime Text is not quite an IDE (Inte­grated Devel­op­ment Envi­ron­ment), but with the installation of a handful of packages/plugins you can really make it the ideal editor for developing PHP in.

The first stable release of CakePHP 3 came out earlier this week so I’ve started the process of updating my Cake plugins. The first one to be updated is VideoEmbed (on the basis that it seems to be the most popular).

As every good developer knows the performance of their code is important. When building websites we want them to be light and fast to give the end-user a fantastic experience. However, far too often developers prefer to take shortcuts to make their lives easier, even at the expense of the site’s performance.

Diagram of CakePHP's observer pattern
CakePHP's Observer Pattern (the Events System)

It seems that Events are an often ignored feature of the CakePHP framework. Introduced in version 2.1 the events system provides a means of applying logic that generally doesn’t belong in a model or controller. Developing in Cake is all about its fat models and skinny controllers, but there are some things that belong in neither, and shouldn’t really be placed in a model just to make it fatter!

Featured Entries

A Beginners Guide to Package Manager Bower and Using Gulp to Manage Components

Package managers like Composer for PHP and NPM for Node have become essential tools for simplifying a developer’s life. A package manager is a tool for keeping track of what you’ve installed, as well as installing and upgrading packages. They also check for dependencies and compatibility. Bower is a package manager for the web.

Calculate a Person's Age in PHP (Accounting for Leap Years)

I've seen a lot of code out there for calculating a person's age that makes the mistake of ignore leap years. If you ignore leap years then the age will be out by a day or more on or around the person's birthday which isn't what you want.

Latest Tweets

Follow Me