本文整理汇总了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;
}