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


PHP ImageHelper::createDirectoryByPath方法代碼示例

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


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

示例1: saveImage

 /**
  * 
  * @param type $fieldName
  * @param type $path 'upload/imageExample/123456789'
  * @param type $oldImage old image filename to delete after resize
  * @return string
  * @copyright (c) 2014, bb
  */
 public function saveImage($fieldName, $path)
 {
     if (array_key_exists($fieldName, $this->aAttributesBeforeSave)) {
         $oldImage = $this->aAttributesBeforeSave[$fieldName];
     }
     if (is_null($this->{$fieldName})) {
         if (!empty($oldImage)) {
             $this->{$fieldName} = $oldImage;
             $this->update(array($fieldName));
         }
         return false;
     }
     if (!empty($oldImage)) {
         $this->deleteImage($fieldName, $path, $oldImage);
     }
     $ext = $this->{$fieldName}->getExtensionName();
     $fileName = time() . '_' . $this->id . '_' . $fieldName . '.' . $ext;
     $imageHelper = new ImageHelper();
     $imageHelper->createDirectoryByPath($path);
     $this->{$fieldName}->saveAs($path . '/' . $fileName);
     $this->{$fieldName} = $fileName;
     $this->update(array($fieldName));
     if (array_key_exists($fieldName, $this->aImageSize) && is_array($this->aImageSize[$fieldName])) {
         $this->resizeImage($fieldName, $path);
     }
 }
開發者ID:jasonhai,項目名稱:onehome,代碼行數:34,代碼來源:MyActiveRecord.php

示例2: saveUserVendorPurchaser

 /**
  * @Author: ANH DUNG Mar 28, 2014
  * @Todo: save user form model ProTransactionsVendorPurchaserDetail
  * @Param: $model is model ProTransactionsVendorPurchaserDetail
  * @Return: model user
  */
 public static function saveUserVendorPurchaser($model, $role_id)
 {
     $mUser = new Users();
     $mUser->scenario = 'abcdef';
     $mUser->first_name = $model->name;
     $mUser->email_not_login = $model->email;
     $mUser->nric_passportno_roc = $model->nric_passportno_roc;
     $mUser->contact_no = $model->contact_no;
     $mUser->address = $model->address;
     $mUser->postal_code = $model->postal_code;
開發者ID:jasonhai,項目名稱:onehome,代碼行數:16,代碼來源:Users.php


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