本文整理汇总了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;