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


PHP ImageHelper::deleteFile方法代碼示例

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


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

示例1: RemoveFileOnly

 public static function RemoveFileOnly($pk, $fieldName)
 {
     $modelRemove = self::model()->findByPk($pk);
     if (is_null($modelRemove) || empty($modelRemove->{$fieldName})) {
         return;
     }
     $aDate = explode('-', $modelRemove->date_only);
     $pathUpload = ProGlobalEnquiry::$folderUpload . "/{$aDate['0']}/{$aDate['1']}/{$aDate['2']}";
     $ImageHelper = new ImageHelper();
     $ImageHelper->folder = '/' . $pathUpload;
     $ImageHelper->deleteFile($ImageHelper->folder . '/' . $modelRemove->{$fieldName});
 }
開發者ID:jasonhai,項目名稱:onehome,代碼行數:12,代碼來源:ProEnquiryGlobalFile.php

示例2: deleteImage

 public function deleteImage($fieldName, $path, $oldImage)
 {
     if (!empty($oldImage)) {
         ImageHelper::deleteFile($path . '/' . $oldImage);
         if (array_key_exists($fieldName, $this->aImageSize) && is_array($this->aImageSize[$fieldName])) {
             $aSize = $this->aImageSize[$fieldName];
             foreach ($aSize as $key => $value) {
                 ImageHelper::deleteFile($path . '/' . $key . '/' . $oldImage);
             }
         }
     }
 }
開發者ID:jasonhai,項目名稱:onehome,代碼行數:12,代碼來源:MyActiveRecord.php

示例3: actionEdit

 /**
  * Displays a particular model.
  * @param integer $id the ID of the model to be displayed
  */
 public function actionEdit()
 {
     if (!empty($this->catalog)) {
         $message = "";
         $catalog = $this->catalog;
         $action = Yii::app()->request->getParam("action", "");
         if ($this->id) {
             $item = $catalog::fetch($this->id);
         } else {
             $item = new $catalog();
         }
         // Удаление картинки
         if ($action == "img_del") {
             $imageField = Yii::app()->request->getParam("field", "");
             if (!empty($imageField)) {
                 ImageHelper::deleteFile($item, $imageField);
                 $item->save();
                 $message = "Фото успешно удаленно";
             }
         }
         // Удаляем картинки в галлере
         if ($action == "gal_del") {
             $id = (int) Yii::app()->request->getParam("img_id", 0);
             if (!empty($id)) {
                 $imageModel = CatGallery::fetch($id);
                 if ($imageModel->id > 0) {
                     $imageModel->delete();
                     $message = "Фото успешно удаленно";
                 }
             }
         }
         $addGallery = new CatGallery();
         if ($item->id > 0) {
             $listImage = CatGallery::fetchAll(DBQueryParamsClass::CreateParams()->setConditions("catalog=:catalog AND item_id=:item_id")->setParams(array(":catalog" => $item->tableName(), ":item_id" => $item->id))->setOrderBy("pos, id")->setCache(0)->setLimit(-1));
         } else {
             $listImage = array();
         }
         $this->arrayParams["catalog"] = $catalog;
         $this->render('edit', array('arrayParams' => $this->arrayParams, 'controller' => $this, 'form' => $item, 'catalog' => SiteHelper::getCamelCase($item->tableName()), 'listImage' => $listImage, 'message' => $message, 'addGallery' => $addGallery));
     }
 }
開發者ID:bogiesoft,項目名稱:yii-travel,代碼行數:45,代碼來源:CatalogController.php

示例4: RemoveFileOnly

 public static function RemoveFileOnly($pk, $fieldName, $aSize)
 {
     $modelRemove = self::model()->findByPk($pk);
     if (is_null($modelRemove) || empty($modelRemove->{$fieldName})) {
         return;
     }
     $pathUpload = ProInventoryPhoto::$folderUpload;
     $ImageHelper = new ImageHelper();
     $ImageHelper->folder = '/' . $pathUpload;
     $ImageHelper->deleteFile($ImageHelper->folder . '/' . $modelRemove->{$fieldName});
     foreach ($aSize as $key => $value) {
         $ImageHelper->deleteFile($ImageHelper->folder . '/' . $key . '/' . $modelRemove->{$fieldName});
     }
 }
開發者ID:jasonhai,項目名稱:onehome,代碼行數:14,代碼來源:ProInventoryPhoto.php

示例5: deleteImage

 public static function deleteImage($model)
 {
     $model = self::model()->findByPk($model->id);
     if (is_null($model) || empty($model->photo)) {
         return;
     }
     $ImageHelper = new ImageHelper();
     $ImageHelper->folder = '/' . self::$folderUpload . '/' . $model->id;
     $ImageHelper->deleteFile($ImageHelper->folder . '/' . $model->photo);
 }
開發者ID:jasonhai,項目名稱:onehome,代碼行數:10,代碼來源:ProReportDefect.php

示例6:

 $mUser->scenario = null;
 $mUser->agent_company_name = $model->company_name;
 $mUser->first_name = $model->salesperson_name;
 if (trim($mUser->first_name) == '' && $model->type == ProTransactionsBillTo::TYPE_VENDOR_PURCHASER) {
     $mUser->first_name = $model->attn_to;
 }
 $mUser->nric_passportno_roc = $model->nric_no;
 $mUser->contact_no = $model->contact_no;
 $mUser->address = $model->billing_address;
 $mUser->postal_code = $model->postal_code;
 $mUser->status = STATUS_INACTIVE;
 $mUser->application_id = FE;
 $mUser->role_id = $role_id;
開發者ID:jasonhai,項目名稱:onehome,代碼行數:13,代碼來源:Users.php


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