本文整理匯總了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']);
}
示例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']);
}