Join Carlo in his adventures through space AND time...

CakePHP Learnings

Posted: April 28th, 2009 | Author: | Filed under: programming | Tags: , , | No Comments »

CakePHP is great, I can’t imagine creating another web application without it or something similar to it. It’s just that sometimes you’ll think “This is how I’d do it normally… But with cake… mmmm.. maybe like this?”. Then if that didn’t work, you’re stuck.

Using the Auth component and trying to create a user account from another Controller that is NOT the “user” controller will lead to weird password hashing. In my experience.

If you want to create files in a certain folder in webroot, most of the time you just need to type in “foldername/file.txt” and not the full path. ie “pdf/stats.pdf” and not “/home/user/htdocs/app/webroot/pdf/stats.pdf”

No matter how many times i’ve used a HABTM relationship before, it still gives me a headache.  Sometimes I feel that sticking to two BelongsToMany relationships would be much easier.

If you have created and modified fields in your table, CakePHP will automatically update it if it does not have a value in the controller.

The manual actually has most of the answers you’re looking for. It’s just sometimes tells you in an obscure or indirect way.

If you want it saved, put it in an array. If that doesn’t save either, put that array in another array.


Project: Double Meta Refresh Update

Posted: December 23rd, 2008 | Author: | Filed under: programming | Tags: , , , | No Comments »

I have now implemented a CSV type upload feature for the double meta refresh project that I have happenning. It’s going along pretty well, I haven’t encoutered any problems yet, except for a limitation with the CakePHP framework where a $model->saveAll() wont’ work on a HABTM relationship. But it doesn’t matter.

I’m thinking of opening it up for beta testing in the near future, but if someone wants access now, just drop in a comment and register to the site and I should be able to give you access.

http://www.doublerefresh.com

The task I am trying to accomplish now is to implement the groups for urls. This feature is to replace the per link country redirection to a group based country redirection. So if you have a whole batch of links that you uploaded via CSV, you wouldn’t have to edit each link so that only the US ips get through. You would just edit the group. Saves you lots of time.

Long story short, I need to get this done quicker so I can get rich quicker.