php

ExtJs Direct - Not enough required params or this.form is undefined

{"type":"exception","tid":4,"message":"Not enough required params specified for method: loadForm  on class ClassNameHere"
}

If you are getting errors like this check firebug to make sure you are sending the data. I was not sending the data because I keep forgetting to set 'paramorder' or 'paramsasHash' on the form config.

CakePHP - The requested address ... was not found on the server

I just installed the new Ubuntu 10.10 on my workstation. I am in the progress to upgrading to CakePHP 1.3 but more on that later. The first problem I had (that I always have because I always forget this):
The requested address .. was not found on the server

Solution? Enable mod_rewrite. On Ubuntu I did
sudo a2enmod rewrite

Print Arrays nicely using pr

I recently had to do some debugging of arrays. Print_r() is very, very ugly:
Array ( [0] => struct SidAndAttributesType { string SecurityIdentifier; unsignedInt Attributes; } [1] => struct NonEmptyArrayOfGroupIdentifiersType { SidAndAttributesType GroupIdentifier; } [2] => struct
I did some research and found a nice solution: use pr() instead of print_r.
Array
(
    [0] => struct SidAndAttributesType {
 string SecurityIdentifier;
 unsignedInt Attributes;
}
    [1] => struct NonEmptyArrayOfGroupIdentifiersType {
 SidAndAttributesType GroupIdentifier;
}
    [2] => struct NonEmptyArrayOfRestrictedGroupIdentifiersType {
 SidAndAttributesType RestrictedGroupIdentifier;
}
Shorter, simpler, sweeter!

Just wasted 20 minutes looking for whitespace...

I just wasted 20 minutes going through files looking for a white space that was causing "headers already sent" error message on login. I finally found it BEFORE the <? (i was looking at the ?> end).

Grrr....

Syndicate content