found a way to incorporate my existing modular CMS code, but I'm
looking for less intrusive setup.
In the old code, all deliverable pages resided in /html/ (deliverable
support files in /images/, /css/, etc.), while various modular
support files for the system are Included from within folders such
as /publish/, /banners/, /events/, etc.
e.g.: A request for /html/home.htm will use PHP's include_once to
call files such as /publish/publish.php and /event/events.php which
contain methods that render content.
In a ZF MVC setup, I have a Route configured for "html/*" that sends
to a Controller which gets the $_SERVER['REQUEST_URI'] string,
verifies that the file actually exists, and then performs a PHP
include for it within the Controller's View script. The end result
is that the old systems work transparently under a ZF MVC setup, and
that lets me easily incorporate new MVC based systems (until I can
replace the old ones).
The drawback is that I have to duplicate this exact Route/Controller
code for each "old world" module folders the site runs: a new module
and controller set up for each of "publish/*", "events/*", "banners/
*", etc...
Within each of these "old world" support Controllers, there are no
specific references to files or paths - everything is built off of
the REQUEST_URI string, so the code is identical, just repeated in
multiple module setups.
This is tedious to set up, and my gut instinct says that combining
these multiple Routes may mean faster page delivery, even if it does
include a regular expression.
Can these standard Routes be consolidated into a single "Old World
support" module using Zend_Controller_Router_Route_Regex?
I've tried using routes such as "(html|publish|events)/(\d+)" and
"(html|publish|events)/*" with no luck. They don't seem to identify
the Route properly
Tim Stiles,
WatchMaker, Icomex.com
没有评论:
发表评论