本文整理汇总了PHP中FileUpload::image方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUpload::image方法的具体用法?PHP FileUpload::image怎么用?PHP FileUpload::image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUpload
的用法示例。
在下文中一共展示了FileUpload::image方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editSave
public function editSave($data)
{
if (isset($data['article_img'])) {
$imgUploader = new FileUpload($data['article_img']['name'], $data['article_img']['tmp_name']);
$l_sNewFileName = $imgUploader->image(ROOT . '/public/assets/product/');
$imgUploader->image(ROOT . '/public/assets/product/thumb/', 218, 129, $data['cropped'][0], $data['cropped'][1], $data['cropped'][2], $data['cropped'][3]);
$this->db->update('article', array('article_name' => $data['article_name'], 'article_price' => $data['article_price'], 'article_date' => $data['article_date'], 'category_id' => $data['category_id'], 'article_featured' => $data['article_featured'], 'artist_id' => $data['artist_id'], 'article_description' => $data['article_description'], 'article_img' => $l_sNewFileName), "article_id = {$data['article_id']}");
} else {
$this->db->update('article', array('article_name' => $data['article_name'], 'article_price' => $data['article_price'], 'article_date' => $data['article_date'], 'category_id' => $data['category_id'], 'article_featured' => $data['article_featured'], 'artist_id' => $data['artist_id'], 'article_description' => $data['article_description']), "article_id = {$data['article_id']}");
}
}
示例2: edit
public function edit($data)
{
if (isset($data['artist_image'])) {
$imgUploader = new FileUpload($data['artist_image']['name'], $data['artist_image']['tmp_name']);
$l_sNewFileName = $imgUploader->image(ROOT . '/public/assets/artist/');
$imgUploader->image(ROOT . '/public/assets/artist/thumb/', 275, 322, $data['cropped'][0], $data['cropped'][1], $data['cropped'][2], $data['cropped'][3]);
$this->db->update('artist', array('artist_name' => $data['artist_name'], 'artist_active' => $data['artist_active'], 'artist_website' => $data['artist_website'], 'artist_featured' => $data['artist_featured'], 'artist_country' => $data['artist_country'], 'artist_description' => $data['artist_description'], 'artist_image' => $l_sNewFileName), "artist_id = {$data['artist_id']}");
} else {
$this->db->update('artist', array('artist_name' => $data['artist_name'], 'artist_active' => $data['artist_active'], 'artist_website' => $data['artist_website'], 'artist_featured' => $data['artist_featured'], 'artist_country' => $data['artist_country'], 'artist_description' => $data['artist_description']), "artist_id = {$data['artist_id']}");
}
}
示例3: edit
public function edit($data)
{
$dataArray = array('event_name' => $data['event_name'], 'event_date' => $data['event_date'], 'event_date_end' => $data['event_date_end'], 'event_description' => $data['event_description']);
if (isset($data['event_image']) || isset($data['event_file'])) {
if (isset($data['event_image'])) {
$imgUploader = new FileUpload($data['event_image']['name'], $data['event_image']['tmp_name']);
$l_sNewFileName = $imgUploader->image(ROOT . '/public/assets/event/');
$imgUploader->image(ROOT . '/public/assets/event/thumb/', 275, 163, $data['cropped'][0], $data['cropped'][1], $data['cropped'][2], $data['cropped'][3]);
$dataArray['event_image'] = $l_sNewFileName;
}
if (isset($data['event_file'])) {
$fileUploader = new FileUpload($data['event_file']['name'], $data['event_file']['tmp_name']);
$l_sNewFileName = $fileUploader->file(ROOT . '/public/assets/file/');
$dataArray['event_file'] = $l_sNewFileName;
}
$this->db->update('event', $dataArray, "event_id = {$data['event_id']}");
} else {
$this->db->update('event', $dataArray, "event_id = {$data['event_id']}");
}
}
示例4: responeJson
<?php
require 'FileUpload.php';
function responeJson($obj)
{
header('Content-Type: application/json');
echo json_encode($obj);
}
$path = 'img/users/';
$fileuploader = new FileUpload('../' . $path);
$fileuploader->image('fileUpload');
// print_r($fileuploader->getInfo());
// print_r($fileuploader->getMessage());
$result = array('fileInfo' => $fileuploader->getInfo(), 'errorMessage' => $fileuploader->getMessage(), 'filepath' => $path . $fileuploader->getInfo()['name']);
return responeJson($result);
示例5: create
public function create($data)
{
$imgUploader = new FileUpload($data['slider_img']['name'], $data['slider_img']['tmp_name']);
$l_sNewFileName = $imgUploader->image(ROOT . '/public/assets/slider/');
$l_aLowestOrder = $this->sliderAll(array('sort' => 'slider_order', 'order' => 'desc', 0, 1));
$l_nNewOrder = $l_aLowestOrder[0]['slider_order'] + 1;
$this->db->insert('slider', array('slider_name' => $data['slider_name'], 'slider_type' => $data['slider_type'], 'slider_target' => $data['slider_target'], 'slider_order' => $l_nNewOrder, 'slider_img' => $l_sNewFileName));
}