public function __call($method, $parms)
{
if (0 === strcasecmp($method, ACTION_NAME)) {
// 检查扩展操作方法
$_action = C('_actions_');
if ($_action) {
// 'module:action'=>'callback'
if (isset($_action[MODULE_NAME . ':' . ACTION_NAME])) {
$action = $_action[MODULE_NAME . ':' . ACTION_NAME];
} elseif (isset($_action[ACTION_NAME])) {
// 'action'=>'callback'
$action = $_action[ACTION_NAME];
}
if (!empty($action)) {
call_user_func($action);
return;
}
}
// 如果定义了_empty操作 则调用
if (method_exists($this, '_empty')) {
$this->_empty($method, $parms);
} else {
// 检查是否存在默认模版 如果有直接输出模版
$this->display();
}
} elseif (in_array(strtolower($method), array('ispost', 'isget', 'ishead', 'isdelete', 'isput'))) {
return strtolower($_SERVER['REQUEST_METHOD']) == strtolower(substr($method, 2));
} else {
throw_exception(__CLASS__ . ':' . $method . L('_METHOD_NOT_EXIST_'));
}
}