本文整理匯總了PHP中FileHelper::getFilename方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileHelper::getFilename方法的具體用法?PHP FileHelper::getFilename怎麽用?PHP FileHelper::getFilename使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileHelper
的用法示例。
在下文中一共展示了FileHelper::getFilename方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Build
/**
* Populates Source View Model
* @return Source_Vm
*/
public function Build()
{
$fname = FileHelper::getFilename();
$data = FileHelper::getFile(Config::$SongDirectory . $fname);
$viewModel = new Source_Vm();
$viewModel->PageTitle = 'Song Source for "' . $fname . '" ChordPro (CPM)/UkeGeeks File Format';
$viewModel->Body = htmlspecialchars($data);
return $viewModel;
}
示例2: Build
/**
* Parses file (using URL query param) and attempts to load View Model
* @return Song_Vm
*/
public function Build()
{
$filename = FileHelper::getFilename();
$fileContent = FileHelper::getFile(Config::$SongDirectory . $filename);
$song = SongHelper::parseSong($fileContent);
$title = htmlspecialchars($song->isOK ? $song->title . (strlen($song->subtitle) > 0 ? ' | ' . $song->subtitle : '') : 'Not Found');
$viewModel = new Song_Vm();
$viewModel->PageTitle = $this->MakePageTitle($song, $filename);
$viewModel->SongTitle = htmlspecialchars($song->title);
$viewModel->Subtitle = htmlspecialchars($song->subtitle);
$viewModel->Artist = $song->artist;
$viewModel->Album = $song->album;
// htmlspecialchars();
$viewModel->Body = $song->body;
$viewModel->UgsMeta = $song->meta;
$viewModel->SourceUri = Ugs::MakeUri(Actions::Source, $filename);
$viewModel->EditUri = Ugs::MakeUri(Actions::Edit, $filename);
$viewModel->Id = $filename;
$viewModel->IsUpdateAllowed = $this->SiteUser->MayEdit && $this->SiteUser->IsAuthenticated;
$viewModel->EditorSettingsJson = $this->getSettings();
return $viewModel;
}