CakePHP Digest #13
Prelude
This digest kind of sucks. As we'd say in high school: My B G (which translates to "My Bad, Gangsta," for those who aren't from dorky middle class America). I have something kind of cool that I hope to get out this week that should make up for it.
News
CakePHP 1.2.3.8166
There is a new bug fix release for the 1.2 branch. The biggest issue this fixes is described below in the Tickets and Commits section.
CakeFest Talks
It looks like all the slots have been assigned for talks at CakeFest.
First 1.3 Site In The Wild?
TheChaw is now running on CakePHP 1.3. I would guess this is the first real CakePHP 1.3 site out there. Although I made a joke a couple digests ago about how everyone should move to 1.3 immediately. Some people didn't realize it was a joke, so for all I know there could be a bunch of sites updated to 1.3 already.
CakePHP Meetup in Dallas
@britg setup a CakePHP meetup for the Dallas area bakers.
Tickets and Commits
I can't even get this post out and it's already fixed.
A low danger XSS vulnerability is currently open closed. The trick allows you to inject HTML into some CakePHP apps. For example here's one of my sites. This doesn't work on all sites. For example the CakePHP sites seem to be immune. I'm calling this one "low danger" because I was only able to get HTML into the page, not JavaScript. Plus, it only works when you get people to visit your hacked link.
See the comment below from Ramon on how to exploit this for JavaScript
In The Wild
www.vendoo.co.za
@johannduplessis announced his latest site: www.vendoo.co.za. It's a "classifieds site and aggregator."
In The Blogs
Pagination With Custom Find Types
Mariano Iglesias has a nice post on doing pagination with custom find types.
Ajax Form Validation
JamNite posted a rather lengthy tutorial on doing Ajax validation using jQuery.
Which teknoid Posts to Highlight?
If I linked to every new teknoid post there wouldn't be room for any other blogs. I'll pick there two: "Give all of your error messages a different layout" and "More pondering about HABTM".
In The Groups
Uhhh....
Code
jQuery Ajax Helper
loadsys.com released a replacement for the default AjaxHelper that uses jQuery. How many of you use the AjaxHelper for generating JavaScript code? I'm interested to know if most people just write their own JS - this is what I do - rather then using the helpers.
Plugin Manager
@rodrigorm pointed out a project he's been working on - a plugin manager.
My Stuff
I updated a few of my projects last week. Since I'm completely obsessed with plugins I'm converting all my code. So far I've done the LazyLoader, Custom Find Types and jQuery Validation. I plan on doing the rest as I get time.
I'm Out!
And on that note don't forget to subscribe to my feed or follow me on twitter.
As always if you think I missed something leave a comment. Or if you do something interesting and want it included in the next digest, send me an email.

18 Comments
1) When leveraging Cake's core pagination...mostly for Admin/CMS portals or when ajax pagination is needed on front-end.
2) We take over support for a lot of CakePHP apps. A lot of these apps are leveraging the ajax helper. We prefer jQuery, so we'll convert the app to jQuery so it is easier for our team to maintain. This helper lets us do this rather quickly...if not seamlessly.
So, I guess we think there is a time and place for it. We have had this helper for a long while, but sometimes get a little busy to find time to contribute code.
Lee Forkenbrock
Loadsys
The main reason I was wondering if people actually use the Ajax helper is Cake's support for multiple JS libs coming in 1.3. I'm tempted to say that this will be no use to me, but maybe I'll be blown away by the awesomeness of it.
-R
I still develop primarily in prototype+scriptaculous. I haven't drank the jQuery koolaid yet. =)
Sorry to comment here. I was trying to comment on you "GitHub Updates" article, but it seems comments are closed.
I'm a bit confused about how to use your jQuery validation plugin with custom rules. You say that we're free to use AJAX. I was wondering if you were talking about a simple AJAX request to do something unrelated to validation, or an AJAX validation.
If you're talking about AJAX validation... well, now it's when I'm confused. I wanna validate if a field is unique, so I wrote something simple to test it:
jQuery.fn.validate.isUnique = function( val, params ) {
$.get( '/validate_uniqueness', {
value: val
},
function(error) {
return error.length == 0;
})
}
And, of course, it doesn't work, for an obvious reason. It sends the value to the server, but it doesn't send the field it wants to validate. I could write tens of functions in both my server and client side to perform validation field by field, but that doesn't look funny :-).
So, is there anything I'm missing here? Is it possible to pass the input field that is validating to my custom function?
Thanks.
BTW, I've forked the project to add a few things I needed: http://github.com/javierm/js_validate
I've been meaning to write about this very topic. Keep any eye out for something next week. You may be right that the plugin needs some changes (adding the field) to make Ajax more usable.
I'll check out your changes as well.
Thanks,
Matt
I've updated my fork so the custom functions recieve the field as well.
Feel free to insult my code, vote for banning me from GitHub, or whatever.
Regards.
Javier.
Add new comment