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


PHP loader::loadClass方法代碼示例

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


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

示例1: deleteAction

 public function deleteAction()
 {
     $delete_id = (int) $this->getParam('delete');
     $this->loadModel();
     $cat_info = $this->model->getRow('#_categories', array('cat_id' => $delete_id));
     // remove dir
     loader::loadClass('Dir');
     Dir::rmdir_r("public/upload/categories/{$delete_id}/");
     // delete from db
     $this->model->db->delete('#_categories', "cat_id = '{$delete_id}'");
     // delete from route db
     $this->model->db->delete('#_route', "route_seo_url = '" . $cat_info['cat_seoUrl'] . "' ");
     // redirect to previus page
     $this->_call($_SERVER['HTTP_REFERER']);
 }
開發者ID:houzoumi,項目名稱:fmi,代碼行數:15,代碼來源:CategoryController.php

示例2: selectedAction

 public function selectedAction()
 {
     $this->loadModel();
     if ($_POST['option'] == "activate") {
         foreach ($_POST['selected'] as $contentid) {
             $this->model->db->update('#_content', array('cont_isactive' => 1), "cont_id = {$contentid}");
         }
     } else {
         if ($_POST['option'] == "deactivate") {
             foreach ($_POST['selected'] as $contentid) {
                 $this->model->db->update('#_content', array('cont_isactive' => 0), "cont_id = {$contentid}");
             }
         } else {
             if ($_POST['option'] == "delete") {
                 foreach ($_POST['selected'] as $contentid) {
                     $cont_info = $this->model->getRow('#_content', array('cont_id' => $contentid));
                     // remove dir
                     loader::loadClass('Dir');
                     Dir::rmdir_r("public/upload/content/{$contentid}/");
                     // delete from db
                     $this->model->db->delete('#_content', "cont_id = '{$contentid}'");
                     // delete from route db
                     $this->model->db->delete('#_route', "route_seo_url = '" . $cont_info['cont_seoUrl'] . "' ");
                 }
             }
         }
     }
     $this->_call($_SERVER['HTTP_REFERER']);
 }
開發者ID:houzoumi,項目名稱:fmi,代碼行數:29,代碼來源:ContentController.php


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