当前位置: 首页>>代码示例>>PHP>>正文


PHP Assert::false方法代码示例

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


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

示例1: admin_go

 /**
  * undocumented function
  *
  * @return void
  * @access public
  */
 function admin_go()
 {
     Assert::false($this->isGet(), '404');
     $validTypes = array('gifts', 'transactions', 'users', 'appeals');
     $type = $this->data['Search']['resource'];
     Assert::true(in_array($type, $validTypes), '404');
     $url = array('controller' => $type, 'action' => 'index', 'all', '?' => 'keyword=' . $this->data['Search']['keyword']);
     $this->redirect($url);
 }
开发者ID:stripthis,项目名称:donate,代码行数:15,代码来源:search_controller.php

示例2: admin_delete

 /**
  * undocumented function
  *
  * @return void
  * @access public
  */
 function admin_delete($id)
 {
     $role = $this->Role->findById($id);
     Assert::notEmpty($role, '404');
     Assert::false(in_array($role['Role']['name'], $this->Role->unEditable), '403');
     $this->Role->del($id);
     $msg = __('Role was successfully removed.', true);
     $this->Message->add($msg, 'ok', true, array('action' => 'admin_index'));
 }
开发者ID:stripthis,项目名称:donate,代码行数:15,代码来源:roles_controller.php

示例3: beforeFilter

 /**
  * undocumented function
  *
  * @return void
  * @access public
  */
 function beforeFilter()
 {
     if (!defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
         Assert::false($this->name == 'App', '404');
         Assert::true(!!$this->action, '404');
     }
     $this->Session = $this->AppSession;
     ClassRegistry::addObject('Component.Session', $this->Session);
     ClassRegistry::addObject('Component.RequestHandler', $this->RequestHandler);
     ClassRegistry::addObject('Component.Cookie', $this->Cookie);
     ClassRegistry::addObject('Component.Email', $this->Email);
     ClassRegistry::addObject('Component.Pgp', $this->Pgp);
     $this->_loadPermissions();
     $this->_setLanguage();
     $this->_loadPluginConfigs();
     if ($this->isAdmin()) {
         $this->layout = 'admin';
     }
     if (defined('CAKEPHP_UNIT_TEST_EXECUTION')) {
         return;
     }
     $this->RequestHandler->setContent('list', 'text/html');
     if (empty($this->ignoreUserSession)) {
         $rules = Configure::read('App.userPermissions.' . User::get('Role.name'));
         Assert::notEmpty($rules, '500');
         $canAccess = Common::requestAllowed($this->name, $this->action, $rules, true);
         if (!$canAccess) {
             Assert::true(User::is('guest'), '403');
             if ($this->isOkForSessionRedirect()) {
                 $this->Session->write($this->loginRedirectSesskey, $this->here);
             }
             $this->Session->write('cant_access', true);
             return $this->redirect('/admin/auth/login', '403', true);
         }
         if (!User::is('guest') && $this->name == 'auth' && $this->action == 'login') {
             $url = '/admin/home';
             if ($this->Session->check($this->loginRedirectSesskey)) {
                 $url = $this->Session->read($this->loginRedirectSesskey);
             }
             $this->redirect($url);
         }
     }
     $here = $this->params['url']['url'];
     if (!empty($here) && $here[0] != '/') {
         $here = '/' . $here;
     }
     $this->setJson('here', $here);
     $ajax = $isAjax = false;
     if ($this->isAjax()) {
         $this->layout = 'ajax';
         $ajax = $isAjax = true;
     }
     $this->set(compact('ajax', 'isAjax', 'here'));
 }
开发者ID:stripthis,项目名称:donate,代码行数:60,代码来源:app_controller.php


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