當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Role::delete方法代碼示例

本文整理匯總了PHP中Role::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Role::delete方法的具體用法?PHP Role::delete怎麽用?PHP Role::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Role的用法示例。


在下文中一共展示了Role::delete方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: display

 public function display()
 {
     $rolelist = new Template();
     $rolelist->load("role_list");
     $actions = ActionList::get("rolelist");
     if (isset($_POST['insert'])) {
         $role = new Role();
         $role->name = $_POST['insert'];
         $role->insert();
     }
     if (isset($_GET['delete'])) {
         $role = new Role();
         $role->ID = $_GET['delete'];
         $role->delete();
     }
     $table = new Table();
     $id = new TableColumn("id", Language::DirectTranslate("ID"));
     $id->autoWidth = true;
     $name = new TableColumn("name", Language::DirectTranslate("NAME"));
     $table->columns->add($id);
     $table->columns->add($name);
     $table->name = "{'dbprefix'}roles";
     $table->actions = "rolelist";
     $table->orderBy = "name";
     $table->cacheName = "rolelist";
     $rolelist->assign_var("TABLE", $table->getCode());
     $rolelist->output();
 }
開發者ID:srueegger,項目名稱:1zu12bB,代碼行數:28,代碼來源:rolelist.php

示例2: delete

 /**
  * Drop role
  *
  * @param void
  * @return null
  */
 function delete()
 {
     if ($this->active_role->isNew()) {
         $this->httpError(HTTP_ERR_NOT_FOUND);
     }
     // if
     if ($this->request->isSubmitted()) {
         $delete = $this->active_role->delete();
         if ($delete && !is_error($delete)) {
             clean_permissions_cache();
             flash_success("Role ':name' has been deleted", array('name' => $this->active_role->getName()));
         } else {
             flash_error("Failed to delete role ':name'", array('name' => $this->active_role->getName()));
         }
         // if
         $this->redirectTo('admin_roles');
     } else {
         $this->httpError(HTTP_ERR_BAD_REQUEST);
     }
     // if
 }
開發者ID:NaszvadiG,項目名稱:activecollab_loc,代碼行數:27,代碼來源:RolesAdminController.class.php

示例3: delete_role

 /**
  * Delete Role
  * Deletes a role from the database
  * 
  * @param mixed $name
  * @return bool
  */
 public function delete_role($name)
 {
     $r = new Role();
     $r->get_by_name($name);
     if ($r->exists()) {
         return $r->delete();
     }
 }
開發者ID:Moro3,項目名稱:duc,代碼行數:15,代碼來源:Auth_simpleauth.php

示例4: __actionEdit

 public function __actionEdit()
 {
     if (array_key_exists('save', $_POST['action'])) {
         $this->__save(Role::load((int) $this->_context[1]));
     } elseif (array_key_exists('delete', $_POST['action'])) {
         try {
             Role::delete((int) $this->_context[1]);
             redirect(ADMIN_URL . '/extension/aac/roles/');
         } catch (RoleException $e) {
             $this->alerts()->append($e->getMessage(), AlertStack::ERROR, $this->errors);
         } catch (Exception $e) {
             $this->alerts()->append(__('An unknown error has occurred. <a class="more">Show trace information.</a>'), AlertStack::ERROR, $e);
         }
     }
 }
開發者ID:brendo,項目名稱:symphony-3,代碼行數:15,代碼來源:content.roles.php

示例5: deleteRole

 public function deleteRole($id)
 {
     $model = new Role();
     $data = $model->delete($id);
     //$this->deleteRoleGroup($id);
     //$this->deleteRoleFilterResource($id);
 }
開發者ID:knatorski,項目名稱:SMS,代碼行數:7,代碼來源:User.php


注:本文中的Role::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。