Well, to list the items in the directory, maybe use the ls method of the
Folder class.

http://api.cakephp.org/class/folder#method-Folderls

To store names in the database, I'd create a table: layouts(id, name,
template, created, updated);

where template refers to the *.ctp file.

I'd possibly goes as far as adding a text field to include the content of
the *.ctp file, to enable revision history, and dump the contents in the
afterSave calback.


On Thu, Jul 16, 2009 at 8:58 AM, DatacenterHellas
<[email protected]>wrote:

>
> Hello all.
>
> I like to create a CMS that will hold many layouts depeding on a page
> content.
>
> e.x. : If the page has a layout for the mane page and then the web
> site owner will deside to have another layout for the offers to be
> able to cage to new layout, and if after three months will need a new
> layout for another part of the web site to be able to change to this
> one for this part of tha web site.
>
> So, my main problem is how to enumerate the available layouts that are
> installed on the CakePHP layouts directory, to give the ability to the
> user to choose the one he prefer for the page that he creates ? ? ?
>
> Also I like to store the layout name in my database and then
> automaticly when the controller start generate the data for the View,
> to change the layout to the chosen one that is stored in the
> database ? ? ?
>
> Kind regards
> Merianos Nikos
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to