To those of you who have at least some sort of MVC framework experience, whether it be ZF or another similar:

I'm going to be re-tackling a CMS for personal use in the next few days. A couple things I've been thinking on and want to get some feedback.

Dynamic routes

For this I see two possibilities. One option which I have used in the past, is use the error controller to disperse a db request for the desired slug. The second is bootstrap a db request in and create a new route for all pages in the db. I believe I chose the first back in the day considering the overhead. I just don't like the idea of a possibly big request like that before a page even loads, when it may not even b necessary, though I also admit using the error controller seems a little sloppy and unprofessional to me.

As I've been doing some reading, I see there is a feature that I have no experience with yet, and that is Zend Cache. I'm not yet sure how this works, but I wonder if it might be looking into using this or a session to cache the results for my routes somehow? And then perhaps on a 404, do one last check to see if that slug exists in case a new page was recently published since the caching.

The Slug and Parameters


I know I had to of got around this at one point, but I don't remember how... If I use a full URL path as my primary key, (ex. "/articles/some/article/name"), if I add pagination to a certain article, how can I add and retrieve parameters to that url? /articles/some/article/name/page/2 would probably start looking for that slug in the db rather than act as only a parameter being passed.