本文整理汇总了PHP中FileManager::Error方法的典型用法代码示例。如果您正苦于以下问题:PHP FileManager::Error方法的具体用法?PHP FileManager::Error怎么用?PHP FileManager::Error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileManager
的用法示例。
在下文中一共展示了FileManager::Error方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
public function process()
{
if (!empty($this->value['tmp_name']) && !empty($this->value['name'])) {
$result = FileManager::MoveUpload($this->value['tmp_name'], $this->_directory . '/' . $this->value['name']);
if (!FileManager::Error()) {
$this->value = basename($result);
} else {
$this->error = 'Unable to upload ' . $this->label . ': ' . FileManager::Error();
}
} else {
$this->value = '';
}
}
示例2: process
public function process()
{
if (!empty($this->value['tmp_name']) && !empty($this->value['name'])) {
$result = basename(FileManager::GetPostedOrUploadedFile($this->_name, $this->_directory, 'jpg,jpeg,png,gif'));
if (!FileManager::Error()) {
$this->value = basename($result);
} else {
$this->error = 'Unable to upload ' . $this->label . ': ' . FileManager::Error();
}
} else {
$this->value = '';
}
}
示例3: trim
<?php
$article->setArray($_POST, false);
if (!empty($_POST['autosummary'])) {
$article['autosummary'] = 1;
$xml = Pagemill_SimpleXmlElement::LoadString($_POST['article']);
if ($xml->p) {
$summary = trim($xml->p[0]->innerXml());
} else {
$summary = trim(Bam_Functions::GetIntro($_POST['article']));
}
$article['summary'] = $summary;
} else {
$article['autosummary'] = 0;
}
$article['image'] = basename(FileManager::GetPostedOrUploadedFile('image', TYPEF_DIR . '/files/public/news', 'jpg,jpeg,png,gif'));
if (FileManager::Error()) {
$pm->addLoop('errors', array('message' => FileManager::Error()));
} else {
$article->save();
}
示例4: trim
// process edit action
if ('POST' == $_SERVER['REQUEST_METHOD']) {
// get and validate name, if any
$name = trim(@$_POST['categoryname']);
if (strlen($name) > 0) {
$category->set('categoryname', $name);
} else {
$errors[] = array('message' => 'Category name cannot be blank.');
}
// get and validate image, if any
if (@$_FILES['categoryimage']['tmp_name']) {
$image = FileManager::MoveFile($_FILES['categoryimage']['tmp_name'], TYPEF_DIR . '/files/public/downloads/' . $_FILES['categoryimage']['name']);
if ($image) {
$image = basename($image);
} else {
$errors[] = array('message' => FileManager::Error());
}
$category->set('categoryimage', $image);
}
$image = $category->get('categoryimage');
// get description, if any
$description = trim(@$_POST['categorydescr']);
$category->set('categorydescr', $description);
// if no errors encountered above
if (empty($errors)) {
// save the changes
if (Download_Category::MODE_ADD == $mode) {
$category->add($name, $image, $description);
} else {
$category->save();
}