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


PHP Permissions::instance方法代码示例

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


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

示例1: getInstance

 function getInstance()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
开发者ID:ngardner,项目名称:BentoCMS,代码行数:8,代码来源:Permissions.php

示例2: action_edit

 public function action_edit($user = null)
 {
     $id = $this->request->param('id');
     try {
         $user = $user != null ? $user : Sentry::getUserProvider()->findById($id);
         $permissions = is_array($user->permissions) ? array_keys($user->permissions) : array();
         //split up the user groups
         $groups = $user->not_in_groups(true);
         $this->_tpl->content = View::factory('s4k/user/manage/edit', array('user' => $user, 'groups' => $groups, 'permissions' => Permissions::instance()->split($permissions)));
     } catch (\Cartalyst\Sentry\Users\UserNotFoundException $e) {
         Hint::set(Hint::ERROR, 'No corresponding user found');
         $this->redirect(Route::url('S4K.users.manage', null, true));
     }
 }
开发者ID:happydemon,项目名称:s4k,代码行数:14,代码来源:Manage.php

示例3: action_edit

 public function action_edit($group = null)
 {
     $id = $this->request->param('id');
     try {
         $group = $group == null ? Sentry::getGroupProvider()->findById($id) : $group;
         //get the permission names of this group
         $permissions = is_array($group->permissions) ? array_keys($group->permissions) : array();
         $this->_tpl->content = View::factory('s4k/groups/edit', array('group' => $group, 'permissions' => Permissions::instance()->split($permissions)));
     } catch (Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
         //set an error message an redirect to the management page
         Hint::set(Hint::ERROR, 'No corresponding group found');
         $this->redirect(Route::url('S4K.groups', null, true));
     }
 }
开发者ID:happydemon,项目名称:s4k,代码行数:14,代码来源:Groups.php

示例4: paginate

 /**
  * This function will return paginated result. Result is an array where first element is 
  * array of returned object and second populated pagination object that can be used for 
  * obtaining and rendering pagination data using various helpers.
  * 
  * Items and pagination array vars are indexed with 0 for items and 1 for pagination
  * because you can't use associative indexing with list() construct
  *
  * @access public
  * @param array $arguments Query argumens (@see find()) Limit and offset are ignored!
  * @param integer $items_per_page Number of items per page
  * @param integer $current_page Current page number
  * @return array
  */
 function paginate($arguments = null, $items_per_page = 10, $current_page = 1)
 {
     if (isset($this) && instance_of($this, 'Permissions')) {
         return parent::paginate($arguments, $items_per_page, $current_page);
     } else {
         return Permissions::instance()->paginate($arguments, $items_per_page, $current_page);
     }
     // if
 }
开发者ID:469306621,项目名称:Languages,代码行数:23,代码来源:BasePermissions.class.php

示例5: manager

 /**
  * Return manager instance
  *
  * @access protected
  * @param void
  * @return Permissions 
  */
 function manager()
 {
     if (!$this->manager instanceof Permissions) {
         $this->manager = Permissions::instance();
     }
     return $this->manager;
 }
开发者ID:469306621,项目名称:Languages,代码行数:14,代码来源:BasePermission.class.php


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