本文整理汇总了PHP中Base_Controller::begin方法的典型用法代码示例。如果您正苦于以下问题:PHP Base_Controller::begin方法的具体用法?PHP Base_Controller::begin怎么用?PHP Base_Controller::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Base_Controller
的用法示例。
在下文中一共展示了Base_Controller::begin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: begin
/**
* begin() checks for security (authentication) using AirUser library.
*
* @method begin()
*/
public function begin()
{
parent::begin();
$this->load->library('AirUser');
$this->load->library('AirHtml');
// load recent view lib
$u = $this->airuser->get_user();
if ($u) {
$this->load->library('AirRecent', array('user' => $u));
}
// Keep current user for later.
$this->user = $u;
// load API
$u = $this->airuser->get_user();
if ($u) {
$this->api = new AIRAPI($u);
}
$this->_init_security();
// supported browsers
if ($this->view == 'html') {
$supported = false;
$this->load->library('user_agent');
$bro = $this->agent->browser();
$ver = $this->agent->version();
// compare the leading version number
try {
$leading = intval(array_shift(explode('.', $ver)));
foreach ($this->browsers as $regex => $num) {
if (preg_match($regex, $bro)) {
if (is_null($num) || $leading >= $num) {
$supported = true;
}
break;
}
}
} catch (Exception $e) {
$supported = true;
//Just let them through
}
// die now if unsupported
if (!$supported) {
$this->airoutput->view = 'unsupported';
$this->airoutput->write();
exit;
}
}
}