From: jason <ja...@gr...> - 2001-08-21 01:56:26
|
While this makes sense in theory, let me try and approach this from a different angle. My train of thought is blocked by a lingering question on how modules will be distributed once BC is mainlined. Are page definition (bcp.xml) files to be included with the module package? While the easy answer may be "yes, why not", it also makes sense to allow for modules to be dropped in the module directory by themselves, so that the site-owners can add the new module to their _already existing_ page definitions where they see fit. The problem I see with replacing the $gPageDef declaration in the page definition is: (begin scenerio) Let's say, my forum app uses this new PageDefBuilder to parse incoming URI's. So this would mean that my forum app module package would contain a 'uri definition file' like you described. Now, on my _already existing_ page definition where I have a navigation module, content management, whatever, I want a forum to appear at the bottom. I would have to lose my existing $gPageDef array to make room for the new module which uses the PageDefBuilder. Something just doesn't make sense here. My first idea/proposal here would be to create a new public method in $Page that gets passed the necessary info to handle the incoming URI and load up the right module. I think this was a bit wordy, but it took some writing before my thoughts were clear. To sum.. instead of a PageDefBuilder to replace the $gPageDef array, we add a $Page->BuildDynamicModule which acts as a gateway to launch a multi-module application, and the appropriate module is determined by comparing the incoming URI to an XML definition file in the module directory. jason Alex Black wrote: > One of the things I would like to do is build a "PageDefBuilder" class which > is capable of accepting some rules from a 'definition file' so you could do > something like this: > > setup an alias for htdocs/forum/* to htdocs/forum/index.php, which would > allow you to receive requests like forum/post/1928374. > > The page in htdocs/index.php would not contain module definitions: it would > import PageDefBuilder, which would import a file from your module dir which > tells it how to build up the module list (in this case, based on the request > uri), put that array into $gPageDef - then import & run Page->BuildPage(); > > That would make your urls elegant (you can parse the request uri into an > array which will tell you what modules to use, and still retain the ability > to cache those module's output) |