if (!$this->getUser()->isAuthenticated())
{
$this->redirect('login/index');
}
我想为不同模块中的许多操作添加此代码。我必须为每个操作复制此代码?我想做些什么:symfony中的重构代码
//module
class Invite
public function executeIndex {
sfConfig:get('redirect');
}
class Home
public function executeIndex {
sfConfig:get('redirect');
}
public function executeShow {
sfConfig:get('redirect');
}
如果不能在不同的模块,虽然它可能在一个单一的?