Customizing Zend View to pull views from a database?

View: New views
2 Messages — Rating Filter:   Alert me  

Customizing Zend View to pull views from a database?

by Jason La :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm a ZF newbie, so please bear with me. I would like to store views
for the front end of a website in a database instead of the file
system.

The admin backend will use the standard method of storing view on the
filesystem using the standard directory structure. But for the
frontend, my web app needs to allow administrators to select how
content is displayed on the frontend.

For example, if it were a standard CMS, the admin control panel would
use the standard filesystem structure. When a user creates a new
article for display to visitors, they should be able to select which
template is used for display.

Is this possible?

Thanks so much,
Jason

===============
Jason La
jasonla@...

Re: Customizing Zend View to pull views from a database?

by Giorgio Sironi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/4/19 Jason La <jasonla@...>
I'm a ZF newbie, so please bear with me. I would like to store views
for the front end of a website in a database instead of the file
system.

Ok, so simplifying, the row will also have a field 'viewPath' other than 'title', 'text', 'date'...

The admin backend will use the standard method of storing view on the
filesystem using the standard directory structure. But for the
frontend, my web app needs to allow administrators to select how
content is displayed on the frontend.

So I guess you will have a select that contains the paths to all the views in a certain folder. You can generate it with opendir() or DirectoryIterator.
 
For example, if it were a standard CMS, the admin control panel would
use the standard filesystem structure. When a user creates a new
article for display to visitors, they should be able to select which
template is used for display.

So in the action used to display the article you you would call Zend_Controller_Action::renderScript($article->viewPath);


--
Giorgio Sironi
Piccolo Principe & Ossigeno Scripter
http://ossigeno.sourceforge.net