本文整理汇总了PHP中AssetsHelper::uploadPath方法的典型用法代码示例。如果您正苦于以下问题:PHP AssetsHelper::uploadPath方法的具体用法?PHP AssetsHelper::uploadPath怎么用?PHP AssetsHelper::uploadPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AssetsHelper
的用法示例。
在下文中一共展示了AssetsHelper::uploadPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseSettings
private function parseSettings()
{
$settings = SettingItem::hasInterface()->get();
$parsedSettings = array();
foreach ($settings as $setting) {
if ($setting->isFile() || $setting->isImage()) {
if (Input::has("setting.{$setting->setting_key}")) {
$value = Input::get("setting.{$setting->setting_key}");
if (Input::hasFile($setting->setting_key)) {
$subFolder = ($setting->isImage() ? "images" : "files") . "/";
$newFilename = uniqid() . "_" . time() . "." . Input::file($setting->setting_key)->getClientOriginalExtension();
$file = Input::file($setting->setting_key);
$file->move(AssetsHelper::uploadPath($subFolder), $newFilename);
$value = $subFolder . $newFilename;
}
$parsedSettings[$setting->setting_key] = $value;
}
} else {
if ($setting->isMultipleChoice()) {
$parsedSettings[$setting->setting_key] = implode("|||", Input::get("setting.{$setting->setting_key}"));
} else {
if (Input::has("setting.{$setting->setting_key}")) {
$parsedSettings[$setting->setting_key] = Input::get("setting.{$setting->setting_key}");
} else {
if (!$setting->isRequired()) {
$parsedSettings[$setting->setting_key] = Input::get("setting.{$setting->setting_key}");
}
}
}
}
}
return $parsedSettings;
}