Migrating to Page Controllers
Subject:   Front controller
Date:   2004-12-13 16:13:36
From:   alexSchmid
Response to: Front controller

3.) hold your views in a Directory not accesible through the browser but by php.

I often use a setup like:

+html //holds you php-scripts
+elements //holds images, css and .js
+templates //holds template files e.g. 'views'

With a setup like this you can employ a template engine like smarty or sigma to populate the views with content and deliver through the page controler. If necessary also in different languages/screen-layouts or with content created by loops for result-sets with not too much effort.

Due to the physical location of the template-files the webserver will never deliver those files to the user. Only trap is to make sure that the directories can be accessed by php and the path is working (use a global value like: /var/www/myDomain/templates/ and complete by the pagecontroller depending on language/view)

Happy programming,
Alex Schmid

P.S.: Excuse my bad english & typos

1 to 1 of 1
1 to 1 of 1