Skip to content

Commit

Permalink
添加aftermainrun触发器
Browse files Browse the repository at this point in the history
  • Loading branch information
kongyuan committed May 29, 2012
1 parent 4957599 commit 8493140
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions class/mvc/controller/Controller.php
Expand Up @@ -25,6 +25,8 @@
/*-- Project Introduce --*/
namespace org\jecat\framework\mvc\controller ;

use org\jecat\framework\util\EventManager;

use org\jecat\framework\auth\IdManager;
use org\jecat\framework\auth\AuthenticationException;
use org\jecat\framework\auth\Authorizer;
Expand Down Expand Up @@ -81,7 +83,9 @@
*/

class Controller extends NamableComposite implements IBean
{
{
const afterMainRun = 'afterMainRun' ;

function __construct ($params=null,$sName=null,$bBuildAtonce=true)
{
$this->setName($sName) ;
Expand Down Expand Up @@ -486,7 +490,10 @@ public function mainRun ()
self::processController($aFrame) ;
}

$this->response()->respond($this) ;
$this->response()->respond($this) ;

// 触发事件
EventManager::singleton()->emitEvent(__CLASS__,self::afterMainRun, array($this)) ;
}

static protected function processController(Controller $aController)
Expand Down

0 comments on commit 8493140

Please sign in to comment.