本文整理匯總了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;
}
}
}