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