2009年3月31日星期二

[fw-mvc] headless controllers

I can't seem to find a lot of documentation on how one would typically implement a controller without a view. Yes, turning off the view is easy, but not my question.
 
Suppose I have a background task that I want to run under certain conditions. Call it controller1/action1. And after it is done, suppose I want it to go to controller2/index. Is the typical implementation to chain these together through redirects?
Like:
class controller1 extends ActionController
{
    function action1Action()
    {
    //do something
    $this->_redirect('/controller2/index');
    }
}
 
Or is it prefered to chain them together in the dispatch chain using custom pre/post dispatch methods?
 
I know ZF has the flexibility to do it many ways, just trying to get an idea of the pros/cons of the different ways.
 

Seth

没有评论: