CakePHP routing issues, perhaps.

Wednesday, 29 October 2008
Tagged: Website, General

Zero producivity, anyone? Tonight saw me knee deep in the CakePHP core trying to track down why the bloody hell my passed parameters were not being correctly passed as inputs to the action on a controller. Frustrating to say the least. PhpNut took some time out to explain routing changes, and point me in the right direction. He's extremely helpful, despite his busy schedule.

While I am on the right track, as it stands, the URL parsing of the core isnt passing my args around. If I had a nice codeblock syntaxhighlighting helper, I would be able to show you some cool code, and the different methods I have been attempting to get this corrected... Alas, its just another item on my todo list thats getting done at a frustratingly slow rate.

Today I created the Recent Posts element, as I had intended to. I also approached PhpNut for a good example of the best way to use requestAction in CakePHP without being messy, or overly demanding on the database. He assures me that he will get back with an example. For the moment, I have gone with element caching, and cache resets on save and update on the relevant models.

Essentially, this means that each time you view the recent posts list on the site (yes, that small list of 5 items) it will be red from a cache on disk. This speeds up the site, reduces queries to the database, and makes for a happy, responsive server. It'd be the perfect solution if I could get the requestAction passing my arguments correctly!

Bit of a storm here tonight, and I am up later than I had intended. Lets hope tomorrow is more productive.

3 Comments

Dale Williams

Dale Williams

Friday, 31 October 2008

Hi Graham

Did you end up getting a response from PhpNut regarding the best way to use requestAction in CakePHP? It would be interesting to hear his views on this.

Graham Weldon

Graham Weldon

Saturday, 1 November 2008

@Dale: Not as yet. He's been more active than usual on the CakePHP IRC Channel on freenode, and I nudge him to provide his example whenever I get the chance. I'll look at posting up what I came up with, in comparison to his suggestion, once I manage to get my hands on it.

Mysery Coder

Mysery Coder

Wednesday, 5 November 2008

I'm also interested to see what you get from this. There are ways of doing it, but a great efficient mechanism from someone like this would be great

Comment on this post