Hung Truong: The Blog!

Craigslist and Google Maps Mashup Thingy: Day 9 – CSS Foo and CakePHP Helpers

April 25, 2007 | 2 Minute Read

Today I did a bunch of CSS, making the mashup thing actually look kind of nice. Later, I may add some more “Web 2.0” features such as drop shadows and gradients. I was having a hard time getting the map to show up in the div with a few of the css layouts I downloaded, so I just decided to code it by hand. I think it looks pretty neat; the map stretches across the whole screen and then the other content is shown in absolutely positioned divs.

I also did some stuff with the CakePHP helpers. CakePHP’s inferiority to Rails is really starting to show to me. I think it’s all a product of PHP having not been created for this kind of MVC design. CakePHP tries to follow the conventions of Rails, but it does so in a sort of copycat manner. As such, the result does not meet or exceed the original.

In the case of Helpers, Rails automagically links the named helper to the controller. In CakePHP, you must specify that a certain controller uses a certain helper. It’s kind of annoying. There also isn’t any support for the Rails convention of “partials,” which is why I’m using their helpers to begin with… It’s annoying.

Also, I find it annoying that CakePHP finds an objects associated objects by default when using “find()” or “findAll().” It’s useful when I want it, but when I don’t, it wastes a lot of memory! Now that I think of it, I’m not sure if Rails does this by default or not. The only reason I mention it is because I kept getting out of memory errors (or more accurately, memory limit errors) with my application. It’s a big waste when all I want is the name of the area and CakePHP fetches ALL of the associated listings for that area…

I must sound really whiny right now. I guess it’s just from some frustration in learning a new language/framework instead of using one that I’m used to. It’s good for me, I won’t argue against that. It’s just a bit disappointing to see all of these flaws when a framework is purported to be things like “stable” and “good.”

Oh, and also, I should say that I think my actual mashup is coming along pretty nicely. It should be ready in a few more “days,” where a “day” is one I am actively working on the mashup. I could probably “release” it pretty soon, but usually when I release something, it means I won’t work on it much anymore, moving to something else I find interesting. So I should probably actually have it done before I release it…