本文整理汇总了PHP中Presenter::make方法的典型用法代码示例。如果您正苦于以下问题:PHP Presenter::make方法的具体用法?PHP Presenter::make怎么用?PHP Presenter::make使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Presenter
的用法示例。
在下文中一共展示了Presenter::make方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editPermissions
public function editPermissions()
{
/** @var SettingsHandler $manageHandler */
$manageHandler = app('xe.settings');
$permissionGroups = $manageHandler->getPermissionList();
return \Presenter::make('settings.permissions', compact('permissionGroups'));
}
示例2: getEdit
public function getEdit(Request $request)
{
$themeId = $request->get('theme');
$fileName = $request->get('file');
$type = $request->get('type', 'template');
// TODO: validate themeid, fileName
if ($themeId === null) {
$e = new InvalidArgumentHttpException();
$e->setMessage('잘못된 요청입니다.');
throw $e;
}
$theme = \Theme::getTheme($themeId);
/** @var ThemeEntity $theme */
$files = $theme->getEditFiles();
if ($fileName === null) {
$fileName = key($files[$type]);
}
if (!is_writable($files[$type][$fileName])) {
\View::share('_alert', ['type' => 'danger', 'message' => '파일을 수정할 권한이 없습니다. 웹서버의 계정이 편집할 파일의 쓰기(w)권한을 가지고 있어야 합니다.']);
}
$fileContent = file_get_contents($files[$type][$fileName]);
$editFile = ['fileName' => $fileName, 'path' => $files[$type][$fileName], 'content' => $fileContent];
return \Presenter::make('theme.edit', ['theme' => $theme, 'files' => $files, 'editFile' => $editFile, 'type' => $type]);
}
示例3: index
public function index()
{
\Frontend::title('XpressEngine3 Settings');
return \Presenter::make('settings.dashboard');
}
示例4: render
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
$responseException = $this->filter($e);
// debugging mode
if (config('app.debug') && $e instanceof AccessDeniedHttpException === false) {
return $this->renderDebugMode($request, $e, $responseException);
}
// post request
if ($request->isMethod('post') && !$request->ajax() && !$request->wantsJson()) {
return redirect()->back()->with('alert', ['type' => 'danger', 'statusCode' => $responseException->getStatusCode(), 'message' => $responseException->getMessage()])->withInput();
}
$view = null;
// ajax request
if ($request->ajax() || $request->wantsJson()) {
$view = \Presenter::makeApi(['message' => $responseException->getMessage()]);
} else {
\Presenter::setSkin('error');
\Theme::selectBlankTheme();
$view = \Presenter::make('error', ['type' => 'danger', 'exception' => $responseException, 'message' => $responseException->getMessage()]);
}
return response($view, $responseException->getStatusCode());
}
示例5: getLogin
/**
* Show the application login form.
*
* @return \Illuminate\Http\Response
*/
public function getLogin(UrlGenerator $urlGenerator, Request $request)
{
$redirectUrl = $this->redirectPath = $request->get('redirectUrl', $urlGenerator->previous());
// common config
$config = app('xe.config')->get('member.common');
$loginRuleName = 'login';
\Frontend::rule($loginRuleName, ['email' => 'required|email_prefix', 'password' => 'required']);
return \Presenter::make('login', compact('config', 'loginRuleName', 'redirectUrl'));
}
示例6: route
protected function route()
{
// implement code
Route::settings(self::getId(), function () {
Route::get('/', ['as' => 'manage.openseminar_1212.index', 'uses' => 'ManagerController@index']);
Route::post('/', ['as' => 'manage.openseminar_1212.updateConfig', 'uses' => 'ManagerController@updateConfig']);
Route::get('/pointLog', ['as' => 'manage.openseminar_1212.point_log', 'uses' => 'ManagerController@pointLog']);
}, ['namespace' => 'Akasima\\OpenSeminar\\Controller']);
Route::fixed($this->getId(), function () {
Route::get('/', ['as' => 'openseminar_1212::index', 'uses' => function (Request $request) {
$title = 'Open seminar 2015-12-12';
// set browser title
Frontend::title($title);
// load css file
Frontend::css($this->asset('assets/style.css'))->load();
// output
return Presenter::make('index', ['title' => $title]);
}]);
});
}