• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AppController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中AppController的典型用法代码示例。如果您正苦于以下问题:PHP AppController类的具体用法?PHP AppController怎么用?PHP AppController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了AppController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: modify

 function modify()
 {
     global $lll, $siteDemo, $allowedMethods;
     $found = FALSE;
     if ($siteDemo || !class_exists('rss')) {
         // It is disabled to save these attributes in the demo version:
         foreach (array("extraHead", "extraBody", "extraTopContent", "extraBottomContent", "extraFooter", "logoImage", "headerBackground") as $attr) {
             if (!empty($this->{$attr})) {
                 $found = TRUE;
                 $this->{$attr} = "";
             }
         }
     }
     foreach (array("homeLocation", "redirectFirstLogin", "redirectLogin", "redirectAdminLogin") as $attr) {
         $ctrl = new AppController();
         if ($this->{$attr}) {
             if (!$ctrl->init($this->{$attr}) || !isset($allowedMethods[$ctrl->method]) || !class_exists($ctrl->getClass())) {
                 return Roll::setFormInvalid("invalidInternalLink", $this->{$attr});
             }
         }
     }
     modify($this);
     $this->uploadImages();
     if ($found) {
         Roll::setInfoText("This feature is not available in the Lite (and demo) version of the program!");
     }
 }
开发者ID:alencarmo,项目名称:OCF,代码行数:27,代码来源:settings.php


示例2: beforeRender

 public function beforeRender()
 {
     AppController::beforeRender();
     $subMenu = array(array("Autorisations", array('controller' => 'Autorisation', 'action' => 'index'), $this->params['action'] == 'index'), array("Membres", array('controller' => 'Autorisation', 'action' => 'members'), $this->params['action'] == 'members'));
     $this->set('subMenu', $subMenu);
     $this->layout = 'connected';
 }
开发者ID:sergeguban,项目名称:ffcportail,代码行数:7,代码来源:AutorisationController.php


示例3: getRequest

 /**
  * Get request object for current request. Returns null if no request is available 
  * (if, for example, the plugin is being run in a batch script - scripts don't use the request/response model)
  *
  * @return Request object or null if no request object is available
  */
 public function getRequest()
 {
     if (($o_app = AppController::getInstance()) && ($o_req = $o_app->getRequest())) {
         return $o_req;
     }
     return null;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:13,代码来源:BaseApplicationPlugin.php


示例4: __construct

 public function __construct()
 {
     $this->redis = new Redis();
     if (!$this->redis->connect(AppConfig::getValue('redis_socket'))) {
         AppController::fatalError('unable to connect to Redis server');
     }
 }
开发者ID:bitcalc,项目名称:allspark,代码行数:7,代码来源:redisconnection.php


示例5: _createFromReflection

 private function _createFromReflection($projectName)
 {
     $this->_name = $projectName;
     $this->_dir = \Fstab::instance()->projectDirectory($projectName);
     $controllerBasePath = rtrim(\Path::instance()->evaluate(":{$this->_name}.apps.controller"), "/\\");
     foreach (glob($controllerBasePath . "/*.php") as $filePath) {
         $fileName = pathinfo($filePath, PATHINFO_FILENAME);
         $controllerClassName = $fileName . 'Controller';
         if (!class_exists($controllerClassName)) {
             require $filePath;
         }
         if (class_exists($controllerClassName)) {
             $reflection = new \ReflectionClass($controllerClassName);
             $this->_controllers[] = AppController::create($this, $reflection);
         }
     }
     $spiritBasePath = rtrim(\Path::instance()->evaluate(":{$this->_name}.spiritPath"), "/\\");
     foreach (glob($spiritBasePath . "/*", GLOB_ONLYDIR) as $dirName) {
         $spiritName = pathinfo($dirName, PATHINFO_FILENAME);
         $spiritFileName = rtrim($dirName, "/\\") . '/abstractor.php';
         $spiritAbstractorClassName = $spiritName . 'Abstractor';
         if (!class_exists($spiritAbstractorClassName) && file_exists($spiritFileName)) {
             require $spiritFileName;
         }
         if (class_exists($spiritAbstractorClassName)) {
             $reflection = new \ReflectionClass($spiritAbstractorClassName);
             $this->_spirits[] = SpiritController::create($this, $reflection);
         }
     }
 }
开发者ID:neel,项目名称:bong,代码行数:30,代码来源:Project.php


示例6: dispatch

 public static function dispatch($request = null)
 {
     $request = self::normalize($request);
     try {
         $class = Inflector::camelize($request['controller']) . 'Controller';
         $controller = Controller::load($class, true);
         return $controller->callAction($request);
     } catch (MissingControllerException $e) {
         if (Controller::hasViewForAction($request)) {
             $controller = new AppController();
             return $controller->callAction($request);
         } else {
             throw $e;
         }
     }
 }
开发者ID:spaghettiphp,项目名称:spaghettiphp,代码行数:16,代码来源:Dispatcher.php


示例7: title

 /**
  * Build SEO title
  *
  * @param string $pageTitle Title of the current item/page/posts...
  */
 function title($pageTitle = null)
 {
     if (!is_object($this->controller)) {
         return;
     }
     if (!$pageTitle) {
         $pageTitle = $this->controller->pageTitle;
     }
     if (!$pageTitle) {
         $pageTitle = ucwords($this->controller->params['controller']);
     }
     $description = Configure::read('AppSettings.description');
     $nameAndDescription = hsc(Configure::read('AppSettings.site_name'));
     if ($description) {
         $description = hsc($description);
         $nameAndDescription = "{$nameAndDescription} - {$description}";
     }
     if ($this->controller->isHome) {
         $this->controller->pageTitle = $nameAndDescription;
     } else {
         $this->controller->pageTitle = "{$pageTitle} • {$nameAndDescription}";
     }
     $this->controller->set('page_title_for_layout', $pageTitle);
     $this->controller->set('site_title_for_layout', $nameAndDescription);
 }
开发者ID:alfo1,项目名称:wildflower,代码行数:30,代码来源:seo.php


示例8: beforeFilter

 function beforeFilter()
 {
     $this->Auth->allow('logout', 'reg', 'password_reset', 'view', 'acoset', 'aroset', 'permset', 'buildAcl');
     parent::beforeFilter();
     $this->Auth->autoRedirect = false;
     //debug($this->Session->read() );
 }
开发者ID:kondrat,项目名称:ta,代码行数:7,代码来源:users_controller.php


示例9: beforeFilter

 /**
  * Displays a view
  *
  * @param mixed What page to display
  * @access public
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (isset($this->Auth)) {
         $this->Auth->allow('display');
     }
 }
开发者ID:kiang,项目名称:olc_baker,代码行数:13,代码来源:PagesController.php


示例10: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     // what pages are allowed for non-logged-in users
     $this->Auth->allow('xml');
     $this->Auth->allow('csv');
     $this->Auth->allow('nids');
     $this->Auth->allow('hids_md5');
     $this->Auth->allow('hids_sha1');
     $this->Auth->allow('text');
     $this->Auth->allow('dot');
     $this->Auth->allow('restSearch');
     $this->Auth->allow('stix');
     // TODO Audit, activate logable in a Controller
     if (count($this->uses) && $this->{$this->modelClass}->Behaviors->attached('SysLogLogable')) {
         $this->{$this->modelClass}->setUserData($this->activeUser);
     }
     // convert uuid to id if present in the url, and overwrite id field
     if (isset($this->params->query['uuid'])) {
         $params = array('conditions' => array('Event.uuid' => $this->params->query['uuid']), 'recursive' => 0, 'fields' => 'Event.id');
         $result = $this->Event->find('first', $params);
         if (isset($result['Event']) && isset($result['Event']['id'])) {
             $id = $result['Event']['id'];
             $this->params->addParams(array('pass' => array($id)));
             // FIXME find better way to change id variable if uuid is found. params->url and params->here is not modified accordingly now
         }
     }
     // if not admin or own org, check private as well..
     if (!$this->_isSiteAdmin()) {
         $this->paginate = Set::merge($this->paginate, array('conditions' => array("OR" => array(array('Event.org =' => $this->Auth->user('org')), "AND" => array(array('Event.distribution >' => 0), Configure::read('MISP.unpublishedprivate') ? array('Event.published =' => 1) : array())))));
     }
 }
开发者ID:vman747,项目名称:MISP,代码行数:32,代码来源:EventsController.php


示例11: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     $this->Auth->allow();
     $this->set('logged_user', $this->Auth->user());
     $this->layout = 'cultural';
 }
开发者ID:iqbaltiger,项目名称:datasurveyproject-cakephp,代码行数:7,代码来源:CommunityController.php


示例12: __construct

 public function __construct()
 {
     parent::__construct();
     $this->TiposPagamento = new TiposPagamento();
     $this->SituacaoConta = new SituacaoConta();
     $this->layout = 'painel';
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:7,代码来源:ParametrosController.php


示例13: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     if ($this->action == 'admin_edit') {
         $this->Security->disabledFields = array('alias');
     }
 }
开发者ID:alandesign,项目名称:croogo,代码行数:7,代码来源:types_controller.php


示例14: beforeFilter

 function beforeFilter()
 {
     parent::beforeFilter();
     // $this->Auth->allow('*');
     //$this->set('menuTab', 'kelas');
     //$this->set('menuTabChild', 'kuis');
 }
开发者ID:ardianferdianto,项目名称:skope2,代码行数:7,代码来源:quizzs_questions_controller.php


示例15: beforeRender

 function beforeRender()
 {
     parent::beforeRender();
     $this->set('service_titles', $this->service_titles);
     $this->set('service_status', $this->service_status);
     $this->set('service_schedule', $this->service_schedule);
 }
开发者ID:searchfirst,项目名称:ODN,代码行数:7,代码来源:services_controller.php


示例16: beforeFilter

 /**
  * beforeFilter
  *
  * @return void
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (!empty($this->siteConfigs['editor']) && $this->siteConfigs['editor'] != 'none') {
         $this->helpers[] = $this->siteConfigs['editor'];
     }
 }
开发者ID:baserproject,项目名称:basercms,代码行数:12,代码来源:EditorTemplatesController.php


示例17: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     // We're doing a backend request, require backend access
     $this->requireBackend();
     $this->set('at_backendpanel', true);
 }
开发者ID:ubnetdef,项目名称:injectengine,代码行数:7,代码来源:BackendAppController.php


示例18: beforeFilter

 /**
  * Displays a view
  *
  * @return void
  * @throws NotFoundException When the view file could not be found
  *	or MissingViewException in debug mode.
  */
 function beforeFilter()
 {
     parent::beforeFilter();
     $this->layout = 'homepage';
     //allows pages without auth so you dont have 2 login :):):):):):)
     $this->Auth->allow('display');
 }
开发者ID:sianto1997,项目名称:XLabs,代码行数:14,代码来源:PagesController.php


示例19: isAuthorized

 /**
  * isAuthorized Method
  * Allows Hippa Admin to Add, Edit, Delete Everything
  * Client Managers & MU MAnagers can only Add Edit Delete to their own group
  * Users cannot see
  * @return void
  */
 public function isAuthorized($user)
 {
     $group = $this->Session->read('Auth.User.group_id');
     // Test group role. Is admin?
     $client = $this->Session->read('Auth.User.client_id');
     // Test Client.
     $acct = $this->Session->read('Auth.User.Client.account_type');
     // Get account type
     if ($group == 2) {
         if (in_array($this->action, array('index', 'view', 'add'))) {
             // Allow Managers to Add
             return true;
         }
         if (in_array($this->action, array('edit', 'delete', 'sendFile'))) {
             // Allow Managers to Edit, delete their own
             $id = $this->request->params['pass'][0];
             if ($this->BusinessAssociateAgreement->isOwnedBy($id, $client)) {
                 return true;
             }
         }
     }
     if ($group == 3 || $acct == 'Initial') {
         $this->Session->setFlash('You are not authorized to view that!');
         $this->redirect(array('controller' => 'dashboard', 'action' => 'index'));
         return false;
     }
     return parent::isAuthorized($user);
 }
开发者ID:dipeshpatel306,项目名称:effective-adventure,代码行数:35,代码来源:BusinessAssociateAgreementsController.php


示例20: beforeFilter

 public function beforeFilter()
 {
     parent::beforeFilter();
     //親(Appcontroller)をふまえた上
     // ユーザー自身による登録とログアウトを許可する
     $this->Auth->allow('add', 'logout');
 }
开发者ID:nimarni,项目名称:templeGET,代码行数:7,代码来源:UsersController.php



注:本文中的AppController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AppDelegationPeer类代码示例发布时间:2022-05-23
下一篇:
PHP AppContext类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap