I am trying to put together a CMS that would allow you to create an
infinite number of pages and add an infinite number of sections (which
are controllers) to that page.
So far, I have a page controller that accepts all URLs that do not
specifically have a route defined: mysite.com/about goes to the pages
controller and looks up the page 'about' and finds all the sections for
that page. The 'about' page might have a 'news' section and a
'content' section. In turn, the 'news' section does a requestAction of
'/news/show', then it does a similar requestAction for the 'content'
section.
The code looks like this:
foreach ($pageSections as $pageSection) {
if ($pageSection['Section']['section_type_id']!='0') {
$requestAction = '/'.
strtolower($pageSection['SectionType']['title']).
'/show';
$pageContent .= $this->requestAction($requestAction,
array('return'
,'pageSection'=>$pageSection
,'permissions'=>$this->permissions
)
);
}
}
My question is: Does this seem like the best way to do this sort of
thing? Is there another way to do it because it seems kind of abstract
and might break easily with an update to the Cake core files.
If this is unclear, please let me know.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---