Re: How to do dynamic includes of controllers

2007-01-11 Thread Dave Rogers

I just wanted to make sure I understood you.

I found this link on cakephp groups:
http://groups.google.com/group/cake-php/browse_frm/thread/6dab044365132bdf/02ffb077f9ebf389?lnk=gst&q=elements&rnum=14#02ffb077f9ebf389

Is that what you had in mind?


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



Re: How to do dynamic includes of controllers

2007-01-11 Thread gwoo

Use elements. Put your requestAction calls in the elements. Do not
return the view from requestAction. Just return the data and have the
element display it.


--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---



How to do dynamic includes of controllers

2007-01-11 Thread Dave Rogers

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
-~--~~~~--~~--~--~---