PHP

Bindable Behavior Now In CakePHP Core

May 23rd, 2008  |  Published in CakePHP, PHP

Bindable Behavior Now In CakePHP Core

It’s not news that Bindable Behavior has saved countless lives in terms of functionality.

As of Changeset 6918 this has now been integrated into the CakePHP core. So, we’ll have something to look forward to in the official release of CakePHP 1.2. Mind you, there may be a lot of other hidden gems in there, I just haven’t been paying attention lately :).

For a complete list of the differences and changes you can check out the
Containable Test Cases for excellent examples of how to use this to it’s full potential.

One of those things that is great to see in the core and to have good test coverage as well. One of the biggest bangs for the buck in terms of site performance after/before/durring adding caching…

Coding Horror: Is HTML a Humane Markup Language?

May 14th, 2008  |  Published in Blogroll, CSS, CakePHP, Code Development, HTML

Coding Horror: Is HTML a Humane Markup Language?

One of the things we’re thinking about while building stackoverflow.com is how to let users style the questions and answers they’re entering on the site. Nothing’s decided at this point, but we definitely won’t be giving users one of those friendly-but-irritating HTML GUI browser layout controls.

I am also bothered by the gui widgets that people tend to like in pages, for one I want more control given to my designers over my ‘users’ pages. Generally people really abuse those controls and make the ugliest darn things. The worst looking emails tend to come from yahoo and other web mail products that have those darn things.

I also like the markup that markdown makes, easy to style into something that flows with the rest of the site. Not by me you know, but by my designers…

Displaying errors

May 7th, 2008  |  Published in Code Development, PHP

Displaying errors

<?php
    $isDev  
= $_SERVER['HTTP_HOST'] == ‘dev.phpguru.org’;
    
$isLive = $_SERVER['HTTP_HOST'] == ‘www.phpguru.org’;

    if (
$isDev) {
        
error_reporting(E_ALL);
        
ini_set(‘display_errors’, 1);

    } elseif (
$isLive) {
        
error_reporting(0);
        
ini_set(‘display_errors’, 0);
    }
?>

sometimes the simple ways are the best ways. I do some very similar things build on this same approach…

(Via phpguru.org - Richard Heyes’ ramblings and code.)

Authorize.net AIM Integration Component

February 27th, 2008  |  Published in CakePHP

Authorize.net AIM Integration Component

A simple component meant to abstract payment processing for Authorize.net’s AIM card processing method.

gonna need this is a couple of weeks ;)

(Via The Bakery: Components.)

Easier Static Pages for CakePHP 1.2

February 5th, 2008  |  Published in CakePHP

Easier Static Pages for CakePHP 1.2

>Traditionally in a CakePHP application, to do static pages you have two options:

  1. Use the built-in Pages controller and either have all static pages reside in /pages/pagename or set up custom routes.
  2. Set up an empty action in a controller.

I didn’t like either of those options.

So what with Nate’s help J. Snook makes a custom ErrorHandler to handle the missing controller actions and gets it to look for views in the /views/controllers folder that match and renders them otherwise it does the normal error thing that cake does. I’m working on an extension to this to replace the default route method that I used to serve items from my ContentsController. I’ll keep you informed of the progress but check out. So my plan will to do a quick check in here for things in Contents that might match the path first (or in the cache ;-) ) some small corrections, thanks to JS

(Via snook.ca - a collection of tips, tricks and bookmarks in web development.)

New UI library for Prototype in the works

November 5th, 2007  |  Published in Blogroll, CakePHP, HTML, JavaScript/AJAX

<

p>New UI library for Prototype in the works: “

Sébastien Gruhier, author of the VERY cool Prototype Window class has started a new initiative to build a complimentary UI library for Prototype. Accompanied by Samuel Lebeau, Juriy Zaytsev and Vincent Le Moign, the team aims to build easy to implement UI components that will enhance the user experience in web applications.

<blockquote><p>At the beginning of the project, it was only a full rewrite of Prototype Window but it became quickly a UI library based on <a href="http://prototypejs.org/">Prototype 1.6</a> and <a href="http://script.aculo.us/">script.aculo.us 1.8</a> to include all my previous components like <a href="http://prototype-carousel.xilinus.com/">Prototype Carousel</a> ….</p></blockquote>
<p>The current version is still in early stages but already provides some nice components:</p>
<ul>
<li>window
<ul>
<li>skinnable</li>
<li>shadowing system independent from window and skinnable</li>
<li>div based</li>
<li>resizable from all borders and corners</li>
<li>custom buttons</li>
<li>Dialogs (like it’s done in <span class="caps">PWC</span>) are not yet implemented but will be done soon</li>
</ul>

  • carousel: only HTML content (no Ajax content)
  • dock (experimental)
  • shadow: a simple class to add shadow on any element with a absolute position.
<p>Full details of the project can be found on <a href="http://blog.xilinus.com/2007/11/4/prototype-ui-beta-version-pwc-reloaded">Sébastien’s blog</a>.

This looks like a great start for those of us who like to use stuff that just works

(Via Ajaxian Blog.)

PHP on Cruise - Assuring compatibility with new PHP versions

October 1st, 2007  |  Published in CakePHP, Code Development, PHP

PHP on Cruise - Assuring compatibility with new PHP versions:

This is definately something I really want to add to my workflow, but I need to tune it to work with SimpleTest that I use with my PHP Projects….

(Via Sebastian Nohn.)

Jonathan Street’s Blog: Lightning Fast Sites & Better Benchmarks

September 25th, 2007  |  Published in PHP

Jonathan Street’s Blog: Lightning Fast Sites & Better Benchmarks:

Jonathan Street has a few tips for developers out there looking to speed things up on their site - seven tips towards “lightning fast sites”.

Some small things to look at but if you do them a lot, it might pay to change your ways… ;) don't forget to read the fine print

(Via PHPDeveloper.org.)