本文整理汇总了PHP中Dir::rmdir_r方法的典型用法代码示例。如果您正苦于以下问题:PHP Dir::rmdir_r方法的具体用法?PHP Dir::rmdir_r怎么用?PHP Dir::rmdir_r使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dir
的用法示例。
在下文中一共展示了Dir::rmdir_r方法的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']);
}