本文整理汇总了PHP中Controller::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Controller::__construct方法的具体用法?PHP Controller::__construct怎么用?PHP Controller::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller
的用法示例。
在下文中一共展示了Controller::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
function __construct()
{
global $basePath;
$respons = array();
parent::__construct();
$parts = $this->getUrlParts();
$this->startSession();
$this->auth($parts[3]);
if ($parts[4] === "schema") {
$dir = $basePath . "tmp/" . $parts[3] . "/" . $parts[5] . ".*";
//echo $dir;
} else {
$dir = $basePath . "tmp/" . $parts[3] . "/" . $parts[4];
}
$dir = str_replace("..", "", $dir);
//$dirReal = realpath($dir); // Do not work on *
if ($dir) {
exec("rm -R {$dir}");
$respons['success'] = true;
$respons['message'] = "Tile cache invalidated";
} else {
$respons['success'] = false;
$respons['message'] = "No tile cache to invalidate.";
}
echo $this->toJSON($respons);
}
示例2: __construct
public function __construct($module = null, $action = null)
{
parent::__construct($module, $action);
$this->_templateobject = new TicketAttachment();
$this->uses($this->_templateobject);
$this->view->set('controller', 'Attachments');
}
示例3: mandroid
function __construct()
{
parent::__construct($this->params);
$this->conf = Registry::getInstance();
$this->model = new mandroid();
$this->view = new vandroid();
}
示例4:
function __construct($Request)
{
parent::__construct($Request);
$this->addActionHandler('index', 'doIndex');
$this->addActionHandler('delete', 'doDelete');
$this->addActionHandler('install', 'doSave');
}
示例5:
function __construct()
{
parent::__construct();
// Instantiate content model
$this->loadModel('content', false);
$this->contentModel = new Content_Model();
}
示例6:
function __construct()
{
parent::__construct();
if (Session::get('user_login')) {
echo '<script type="text/javascript"> window.location.replace("' . URL . 'dashboard") </script>';
}
}
示例7: __construct
public function __construct()
{
if ($this->resource_type == null) {
throw new Exception("@todo ERROR_MISSING_RESOURCE_TYPE");
}
parent::__construct();
}
示例8: __construct
public function __construct($id, $module = null)
{
parent::__construct($id, $module);
if ($this->_facebook === null) {
$this->_facebook = new Facebook(array('appId' => Yii::app()->params['fbAppId'], 'secret' => Yii::app()->params['fbAppSecret'], 'cookie' => true));
}
}
示例9: __construct
public function __construct($module = null, $action = null)
{
parent::__construct($module, $action);
$this->_templateobject = DataObjectFactory::Factory('ModuleComponent');
$this->uses('ModuleDefault', false);
$this->uses($this->_templateobject);
}
示例10: __construct
public function __construct()
{
parent::__construct();
Config::set('auth.driver', 'adminauth');
Asset::add('bootstrap', 'bundles/adminify/css/bootstrap.min.css');
Asset::add('style', 'bundles/adminify/css/style.css');
}
示例11: __construct
public function __construct($request = null, $response = null)
{
if (CAKEAPP_ENV == 'development') {
$this->components['DebugKit.Toolbar'] = array();
}
parent::__construct($request, $response);
}
示例12: __construct
public function __construct($request, $response)
{
/*{{{*/
parent::__construct($request, $response);
$clients = array('auditorClient', 'threadCateClient', 'userClient', 'spaceClient', 'doctorClient', 'hospitalClient', 'hospitalFacultyClient', 'PatientClient', 'DoctorPatientPostClient', 'inspectClient');
foreach ($clients as $client) {
$this->{$client} = new ClientProxy($client);
}
$userId = UserClient::getInstance()->getCheckedSeed('id');
if ($userId) {
$this->curUser = DAL::get()->find('user', $userId);
} else {
$this->curUser = new NullEntity();
}
$response->curUser = $this->curUser;
$response->staticUrl = 'http://i1.hdfimg.com/in/case';
$response->leftWidth = '40%';
//$response->leftWidth = '43%';
$response->controller = $request->controller;
$response->action = $request->action;
$response->showContent = $request->showContent;
$this->user = $response->user;
$this->curInspector = $response->curInspector;
$this->auditor = $response->auditor;
if (false == $this->auditor instanceof Auditor) {
$auditor = $this->curInspector->getAuditorEntity4auditfront();
$this->auditor = $auditor;
}
$response->args = array();
$response->isAjax = $request->ajax_status;
}
示例13: __construct
public function __construct()
{
parent::__construct();
if (isset($_GET['f']) and !empty($_GET['f']) and $_GET['f'] != 'show' and $_GET['f'] != 'showOneGroup' and $_GET['f'] != 'showOneTeacher' and $_GET['f'] != 'showOneRoom' and $_GET['f'] != 'checkTitle' and $_GET['f'] != 'checkTeachers' and $_GET['f'] != 'checkRoom' and $_GET['f'] != 'create_comm' and $_GET['f'] != 'create_comm_teacher' and $_GET['f'] != 'check_create_comm' and $_GET['f'] != 'heck_create_comm_teacher' and $_GET['f'] != 'delete') {
header("Location: " . URL . '?c=showTimeTable&f=show');
}
}
示例14: __construct
public function __construct($registry)
{
parent::__construct($registry);
Journal2DBUpgrade::check();
if (isset($this->request->server['HTTPS']) && ($this->request->server['HTTPS'] == 'on' || $this->request->server['HTTPS'] == '1')) {
$this->data['base'] = HTTPS_CATALOG;
} else {
$this->data['base'] = HTTP_CATALOG;
}
$this->data['base_href'] = $this->url->link('module/journal2', 'token=' . $this->session->data['token'], 'SSL');
$this->data['export_href'] = $this->url->link('module/journal2/rest/data/export', 'token=' . $this->session->data['token'], 'SSL');
$this->data['import_href'] = $this->url->link('tool/backup', 'token=' . $this->session->data['token'], 'SSL');
$this->data['export_csv'] = $this->url->link('module/journal2/rest/newsletter/export_csv', 'token=' . $this->session->data['token'], 'SSL');
$this->data['transition_gallery_href'] = $this->url->link('module/journal2/transition_gallery', 'token=' . $this->session->data['token'], 'SSL');
$this->data['journal2_config'] = array();
$this->data['journal2_config']['token'] = $this->session->data['token'];
$this->data['journal2_config']['version'] = defined('JOURNAL_VERSION') ? JOURNAL_VERSION : null;
$this->data['journal2_config']['user_id'] = $this->user->getId();
$this->data['journal2_config']['items_per_page'] = 20;
if (!property_exists('Front', 'IS_OC2')) {
echo '
<h3>Journal Installation Error</h3>
<p>Make sure you have uploaded all Journal files to your server and successfully replaced <b>system/engine/front.php</b> file.</p>
<p>You can find more information <a href="http://docs.digital-atelier.com/opencart/journal/#/settings/install" target="_blank">here</a>.</p>
';
exit;
}
$this->data['journal2_config']['oc2'] = Front::$IS_OC2;
}
示例15: __construct
public function __construct($id, $module = null)
{
if (Yii::app()->request->isAjaxRequest) {
$this->layout = false;
}
parent::__construct($id, $module);
}