显示信息
null Core_Controller::show_message( string $msg [, int $code = integer 0 , $data = array(0) ] )
参数列表
参数 类型 描述 默认值 $msg
string
$message $code
int
$code integer 0 $data
unknown
array(0)
public function show_message($msg, $code=0, $data = array())
{
$out = array
(
'code' => $code,
'msg' => (string)$msg,
'data' => $data,
);
if (IS_SYSTEM_MODE)
{
// 系统内部调用模式
echo $msg;
exit;
}
if (HttpIO::IS_AJAX)
{
@header('Content-Type:application/json');
echo json_encode($out);
exit;
}
else
{
View::factory((IS_ADMIN_MODE?'admin/':'') .'message', $out)->render(true);
}
if (method_exists($this, 'after'))
{
$this->after();
}
exit;
}