Hi,
is_null, as we didn't manage to chat directly in IRC on weekend, I post
my questions related to your design draft
(http://rafb.net/p/VLt8Wm42.html) here on the list...
The questions are about your example code:
> // ezcMvcUrlUserInputTieinRequestParser implements
> // ezcMvcRequestParserInterface
> $parser = new ezcMvcUrlUserInputTieinRequestParser();
>
> // The parser returns an instance of ezcMvcInput.
> $input = $parser->getInput();
>
> // ezcMvcUrlUserInputTieinRouter implements ezcMvcRouterInterface
> $router = new ezcMvcUrlUserInputTieinRouter( $input );
>
> // An array of routers
> $controllers = $router->getControllers();
> // For example, an instance of ezcMvcTemplateTieinHtmlViewManager
> $viewManager = $router->getViewManager();
>
> foreach( $controllers as $controller )
> {
> $viewManager->appendOutput( $controller->run( $input ) );
> }
>
> // Creates the response and sends it to the client.
> $viewManager->handle();
Can you give an example, where it is usefull (at the beginning of
request handling) to fetch a set of controllers? Perhaps I'm blind or
I'm thinking in a wrong direction, but I can't imagine a situation
where I need this. (Of course, you could need re-routing, but I guess,
this is the result of the controller. Before running the first
controller, I do not know about a second controller.)
The second point is somehow related: you append several outputs to the
view manager. I'm not sure, if I like this. I think, there should be
one output object.
If I'd need something like a set of controllers or outputs, I guess, I'd
implement a controller container that runs the several needed
controllers, and then composes one output object from the several
returned output objects.
Also I think, that I'd put some of your script code in the router's(?)
code. I'd write it somehow like this:
// ezcMvcUrlUserInputTieinRequestParser implements
// ezcMvcRequestParserInterface
$parser = new ezcMvcUrlUserInputTieinRequestParser();
// The parser returns an instance of ezcMvcInput.
$input = $parser->getInput();
// ezcMvcUrlUserInputTieinRouter implements ezcMvcRouterInterface
$router = new ezcMvcUrlUserInputTieinRouter();
$output = $router->run( $input );
// For example, an instance of ezcMvcTemplateTieinHtmlViewManager
$viewManager = $router->getViewManager( $output );
// Creates the response and sends it to the client.
$viewManager->handle();
Or even:
// ezcMvcUrlUserInputTieinRequestParser implements
// ezcMvcRequestParserInterface
$parser = new ezcMvcUrlUserInputTieinRequestParser();
// For example, an instance of ezcMvcTemplateTieinHtmlViewManager
$viewManager = new ezcMvcTemplateTieinHtmlViewManager()
// ezcMvcUrlUserInputTieinRouter implements ezcMvcRouterInterface
$router = new ezcMvcUrlUserInputTieinRouter(
$parser,
$viewManager
);
$router->run();
Btw: Who talked about an eZ Publish rewrite in 10 lines? :-)
Have a nice day
Thomas
--
Components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/components