本文整理汇总了PHP中core\Controller类的典型用法代码示例。如果您正苦于以下问题:PHP Controller类的具体用法?PHP Controller怎么用?PHP Controller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Controller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error
/**
* Error
*
* Display an error page if there's no controller
* that corresponds with the current url.
*/
private static function error()
{
$error = self::$url[0] == '500' ? '500' : '404';
self::$controller = new Controllers\Error();
self::$controller->index($error);
exit;
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->helper(array('view', 'tools'));
save_log_data();
}
示例3:
function __construct()
{
parent::__construct();
if ($this->uid) {
$this->redirect('/?m=home');
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->_files = $this->loadModel('model_files');
$this->_user = $this->loadModel('model_user');
$this->checkCookie();
}
示例5: __construct
/**
* Call the parent construct
*/
public function __construct()
{
parent::__construct();
$this->language->load('Welcome');
$this->users = new \Models\Users();
$this->userLogged();
}
示例6: __construct
public function __construct()
{
parent::__construct();
if ($this->uid) {
$this->redirect('/?');
}
}
示例7: __construct
public function __construct()
{
parent::__construct();
$this->locale->load('Welcome');
// Model can be initialized in constructur
// $this->model = new \Modules\Test\Models\SampleModelInModule();
}
示例8: __construct
public function __construct()
{
// Normally construct the application controller
parent::__construct();
// !!! Your module cunstructer here !!! //
/*
Module template option ('module_view_paths') When set to true, the template system will load
the pages view file from the the templates module view folder if it exists:
( template_path/module_views/module_name/viewname.php )
If it doesnt exist, then it loads the default module view file:
( modules/module_name/views/viewname.php )
If set to false, it will load the default view for the URI
( template_path/views/controller/viewname.php ) )
*/
$this->Template->config('module_view_paths', true);
/*
Example loading a module config file
First Param => 'Module Name',
Second Param => 'Config Array Name', ( !! Must be Unique! Cannot be 'Core', 'App', OR 'DB' !! )
Third Param => 'Config File Name',
Forth Param => 'Array Variable Name' ( !! ONLY IF config options are in an array !! )
*/
load_module_config('Devtest', 'mod_config', 'config.php', 'config_options');
// Usage
$this->Config = load_class('Config');
$this->Config->get('var_name', 'mod_config');
// OR
config('var_name', 'mod_config');
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->audit = new \Models\Audit();
$this->users = new \Models\Users();
$this->keys = new \Models\Keys();
}
示例10: __construct
/**
* Call the parent construct
*/
public function __construct()
{
parent::__construct();
$this->language->load('Welcome');
$this->_pages = new \Models\Pages();
$this->_welcomes = new \Models\Welcomes();
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->loadModel('messageModel');
$this->loadModel('pageModel');
$this->loadModel('slideModel');
}
示例12: __construct
/**
* Call the parent construct
*/
public function __construct()
{
parent::__construct();
$this->entradas = new \Models\Entradas();
$this->tags = new \Models\Tags();
$this->entradashastags = new \Models\Entradashastags();
}
示例13: __construct
public function __construct()
{
parent::__construct();
if (!Session::get('loggedin')) {
Url::redirect('login');
}
}
示例14:
function __construct()
{
parent::__construct();
if (!$this->uid) {
$this->redirect('/?m=member&c=login');
}
}
示例15: __construct
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->model('travflex/search_model');
$this->load->helper(array('view', 'tools'));
save_log_data();
}