【发布时间】:2011-10-28 11:34:52
【问题描述】:
让所有控制器以页面标识符作为参数重定向到站点的基本控制器,然后让基本控制器基于该参数周围的一些逻辑重定向,这是一个好的设计吗?
//base controller
function __construct($fromPage, $toPage) {
parent::__construct();
if($toPage == 'member_only') {
$this->is_logged_in();
}
}
function is_logged_in($controller) {
//redirect to appropriate controller from here?
}
关于基本控制器实践的一些建议会很棒:)
【问题讨论】:
标签: php codeigniter architecture