本文整理汇总了PHP中Controller_Template::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller_Template::__construct方法的具体用法?PHP Controller_Template::__construct怎么用?PHP Controller_Template::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller_Template
的用法示例。
在下文中一共展示了Controller_Template::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($request, $response)
{
$this->info = new AdminInfo();
$this->translator = FrontHelper::getTranslation();
View::set_global('translator', $this->translator);
parent::__construct($request, $response);
}
示例2: __construct
public function __construct(Request $request)
{
if (Request::$is_ajax) {
$this->profiler = NULL;
$this->auto_render = FALSE;
}
$this->session = Session::instance();
parent::__construct($request);
}
示例3: __construct
public function __construct($request)
{
parent::__construct($request);
$this->template = View::factory('hmo_masterpage');
$config = Kohana_Config::instance()->load("config");
$this->site = $config['app_path'];
$this->session = Session::instance();
if ($this->authenticate) {
$this->authenticate();
}
$this->message = I18n::load('en-us');
}
示例4: __construct
public function __construct(Request $request)
{
parent::__construct($request);
if (!Kohana::config('shindig.use_authentication')) {
// Redirect to the home page
$this->request->redirect('');
}
if ($user = Cookie::get('authorized')) {
$user = Sprig::factory('user', array('username' => $user))->load();
if ($user->loaded()) {
// User is logged in
$this->user = $user;
Shindig::$has_auth = TRUE;
}
}
if (!$this->user) {
// Force the user to login
$this->request->action = 'login';
}
}
示例5: __construct
public function __construct(Request $request, Response $response)
{
parent::__construct($request, $response);
if (!isset($_COOKIE['cms_milestone_language'])) {
setcookie('cms_milestone_language', I18n::lang(), time() + 60 * 60 * 24 * 30);
}
if (isset($_POST['language_website'])) {
setcookie('cms_milestone_language', $this->request->post('language_website'), time() + 60 * 60 * 24 * 30);
$new_adress = $this->request->post('language_website') . substr($this->request->uri(), strpos($this->request->uri(), '/'));
HTTP::redirect(URL::site($new_adress, TRUE), 302);
}
if (!$this->request->param('language')) {
print_r($_COOKIE);
if (isset($_COOKIE['cms_milestone_language'])) {
HTTP::redirect($_COOKIE['cms_milestone_language'] . '/' . $this->request->uri(), 302);
} else {
HTTP::redirect(I18n::lang() . '/' . $this->request->uri(), 302);
}
}
I18n::lang($this->request->param('language'));
$this->_session = Session::instance();
$this->_auth = Auth::instance();
/*
if( !empty( $_COOKIE['cms_lang'] ) )
{
if( isset( $_POST['cms_lang'] ) )
{
I18n::lang($_POST['cms_lang']);
setcookie( 'cms_lang', $_POST['cms_lang'], time()+(60*60*24*30) );
HTTP::redirect( $_SERVER['REQUEST_URI'] );
}
}
else
{
I18n::lang('pl-pl');
setcookie( 'cms_lang', 'pl-pl', time()+(60*60*24*30) );
}
*/
}
示例6: __construct
public function __construct($request)
{
$session = Session::instance();
$mobile = $session->get('mobile');
if (isset($_REQUEST['mobile'])) {
$mobile = true == $_REQUEST['mobile'];
}
if (is_null($mobile)) {
$ua = $_SERVER['HTTP_USER_AGENT'];
$matches = array('/iPhone/i', '/iPod/i', '/iPad/i');
$mobile = false;
foreach ($matches as $match) {
if (preg_match($match, $ua)) {
$mobile = true;
break;
}
}
}
$session->set('mobile', $mobile);
if ($mobile) {
$this->template = 'mobile';
}
parent::__construct($request);
}
示例7:
function __construct(Request $request)
{
parent::__construct($request);
}
示例8:
function __construct($request, $response)
{
parent::__construct($request, $response);
}
示例9: __construct
public function __construct(Kohana_request $request)
{
parent::__construct($request);
}
示例10: __construct
public function __construct(\Request $request, \Response $response)
{
$this->force_this_main_template = 'blank';
parent::__construct($request, $response);
}
示例11: __construct
/**
* Default class construct
*/
public function __construct($request, $response)
{
$this->config = Kohana::$config->load('application');
parent::__construct($request, $response);
}