Fabien POTENCIER wrote:

FYI: This thread was originally on the users mailinglist:
http://groups.google.com/group/symfony-users/browse_frm/thread/9cefef6adc4b6a57/b8f663e6a03f328f?tvc=1#b8f663e6a03f328f

You can get the "presentation" (HTML) of a module in your actions:

$this->moduleContent = $this->getPresentationFor('moduleName', 'actionName');

OK, I think I will use that to remove my current hack that relies on components to provide the index view.

Looking deeper into how symfony handles module loading it seems if I want to integrate this idea of having page names which are associated with multiple modules who's output can be placed into layout.php, I need to hack on the controller and filter handling. So instead of passing in a module with an action you now can pass in a page name with multiple actions.

Somehow I am not liking how modules are being loaded in general in symfony, but I guess its too late in the game to start messing with that. I just dont understand why forward() is currently used by default and why there is no way to call a module action without having to go through the entire filter chain.

Anyways I guess what I need to do is provide an alternative sfController::forward(). It might even make sense to rewrite sfFrontWebController::dispatch() to call a different method entirely. This method will lookup if a page is configured by the "module name" that was passed and if so load all of these modules and place them on the stack. Then I will probably also have to mess with sfExecutionFilter and/or sfPHPView to be able to handle the output from multiple modules. Finally I will have to find some elegant solution so that modules only see the parameters that were directed at them.

For that last point I also had a solution in my WebBuilder2 framework. Essentially parameters were passed as an associative array. There was a "system" key which was for anything directed at the framework itself (like the name of the page to load). Other keys were named according to the "placeholder element" in the layout template. In the page configuration you would define what layout template to use and what "placeholder elements" exist and what modules are to be loaded.

I had a fairly clever way of generating get urls using either classic get &-separated key/value pairs or alternatively fake directories with mod_rewrite. However I could also configure the urls to ommit keys based on the system and page configuration. So for example:

Load the page called "blog" (system is configured to interpret the first parameter as the page name):
http://pooteeweet.org/blog

Load the page called "blog" and load the news item with id 538 (again on the system level it is determined that "blog" is the name of the page, but the 538 is interpreted as the news id based on the page configuration:
http://pooteeweet.org/blog/538

Load the page called "blog" and load the second page of the news item with id 538:
http://pooteeweet.org/blog/538/p/2

Load the page called "blog" and show the 4th page in the topic list view:
http://pooteeweet.org/blog/p/4

http://svn.oss.backendmedia.com/library/Param/WWW.phps

Also there were different parameter handling classes to handle when the framework was called via an email, the shell etc. we planned to also develop soap handlers.

Hope this is somewhat clear. If there are any questions ask me on #symfony or here.

regards,
Lukas

PS: happy new year!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "symfony 
developers" 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/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to