本文整理匯總了PHP中ImageHelper::upload方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageHelper::upload方法的具體用法?PHP ImageHelper::upload怎麽用?PHP ImageHelper::upload使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImageHelper
的用法示例。
在下文中一共展示了ImageHelper::upload方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handleFileUpload
/**
* Override parent
*/
function handleFileUpload($fileParameters, $id)
{
$filename = $this->fileDefaultName;
if (array_key_exists($this->parameterFile, $fileParameters) and array_key_exists('name', $fileParameters[$this->parameterFile]) and $fileParameters[$this->parameterFile]['name'] != '') {
$imageHelper = new ImageHelper();
$filename = $imageHelper->upload($this->fileBasename, $id, $fileParameters[$this->parameterFile]);
/*if ($filepath != "") {
$imageHelper = new SimpleImage();
$imageHelper->load($filepath);
$imageHelper->resize(100,100);
$imageHelper->save('../img/news/News-".$id."100x100.png');
}*/
}
return $filename;
}
示例2: post_uploadPicture
public function post_uploadPicture()
{
$uuid = Input::get("uuid");
$profile = Input::get("profile") ? 1 : 0;
$this->file = Input::file("foto");
$image = new ImageHelper();
$userInfo = array("uuid" => $uuid, "profile" => $profile);
$image->upload($this->file, "uploads/user/", $userInfo);
if ($image) {
return Redirect::to("/");
}
}
示例3: post_uploadPicture
public function post_uploadPicture()
{
$uuid = Input::get("uuid");
$own = Input::get("own");
$is_profile = Input::get("is_profile") ? Input::get("is_profile") : 0;
$this->file = Input::file("foto");
$image = new ImageHelper();
$userInfo = array("uuid" => $uuid, "profile" => $is_profile);
$image->upload($this->file, "uploads/pet/", $userInfo);
if ($image) {
return Redirect::to("/pet/mascota-profile/" . $own . "/" . $uuid);
}
}
示例4: handleFileUpload
/**
* Override parent
*/
function handleFileUpload($fileParameters, $id)
{
$filename = $this->fileDefaultName;
if (array_key_exists($this->parameterFile, $_FILES) and array_key_exists('name', $_FILES[$this->parameterFile]) and $_FILES[$this->parameterFile]['name'] != '') {
$fileHelper = new ImageHelper();
$filename = $fileHelper->upload($this->fileBasename, $id, $_FILES[$this->parameterFile]);
}
return $filename;
}