本文整理汇总了PHP中CMS::backendPath方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::backendPath方法的具体用法?PHP CMS::backendPath怎么用?PHP CMS::backendPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS
的用法示例。
在下文中一共展示了CMS::backendPath方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->check()) {
return new RedirectResponse(url(\CMS::backendPath()));
}
return $next($request);
}
示例2: handle
/**
* Handle an incoming request.
*
*
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->guest()) {
if ($request->ajax()) {
throw new AuthenticateException('Unauthorized.');
} else {
return redirect()->guest(\CMS::backendPath() . '/auth/login');
}
}
return $next($request);
}
示例3: __construct
/**
* @param Request $request
* @param Response $response
* return void
*/
public function __construct(Request $request, Response $response, SessionStore $session, Guard $auth)
{
$this->request = $request;
$this->response = $response;
$this->session = $session;
$this->currentUser = $auth->user();
if (auth()->check()) {
\Lang::setLocale($this->currentUser->locale);
}
$this->loginPath = \CMS::backendPath() . '/auth/login';
// Execute method boot() on controller execute
if (method_exists($this, 'boot')) {
app()->call([$this, 'boot']);
}
if ($this->authRequired) {
$this->beforeFilter('@checkPermissions');
}
}
示例4: findActivePageByUri
/**
* @param string $currentUri
* @return boolean
*/
public function findActivePageByUri($currentUri)
{
$found = FALSE;
$adminDirName = \CMS::backendPath();
foreach ($this->getPages() as $page) {
$url = $page->getUrl();
$len = strpos($url, $adminDirName);
if ($len !== FALSE) {
$len += strlen($adminDirName);
}
$url = substr($url, $len);
$len = strpos($currentUri, $adminDirName);
if ($len !== FALSE) {
$len += strlen($adminDirName);
}
$uri = substr($currentUri, $len);
if (!empty($url) and strpos($uri, $url) !== FALSE) {
$page->setStatus(TRUE);
Collection::setCurrentPage($page);
$found = TRUE;
break;
}
}
if ($found === FALSE) {
foreach ($this->getSections() as $section) {
$found = $section->findActivePageByUri($currentUri);
if ($found !== FALSE) {
return $found;
}
}
}
return $found;
}
示例5: function
<?php
Route::group(['prefix' => CMS::backendPath()], function () {
Route::get('/', ['as' => 'backend.dashboard', 'uses' => 'DashboardController@index']);
Route::get('/settings', ['as' => 'backend.settings', 'uses' => 'SystemController@settings']);
Route::get('/about', ['as' => 'backend.about', 'uses' => 'SystemController@about']);
Route::get('/phpinfo', ['as' => 'backend.phpinfo', 'uses' => 'SystemController@phpInfo']);
});
Route::post('/api.settings.update', ['as' => 'api.settings.update', 'uses' => 'API\\SettingsController@post']);
app('router')->before(function () {
Route::group(['namespace' => 'KodiCMS\\CMS\\Http\\Controllers', 'prefix' => CMS::backendPath()], function () {
Route::get('cms/{file}.{ext}', 'System\\VirtualMediaLinksController@find')->where('file', '.*')->where('ext', '(css|js|png|jpg|gif|otf|eot|svg|ttf|woff)');
Route::get('{slug}', ['as' => 'backendError', 'uses' => 'System\\ErrorController@show'])->where('slug', '(.*)?');
});
});
示例6: function
<?php
Route::group(['prefix' => \CMS::backendPath()], function () {
Route::get('user/{id}/edit', ['as' => 'backend.user.edit', 'uses' => 'UserController@getEdit'])->where('id', '[0-9]+');
Route::post('user/{id}/edit', ['as' => 'backend.user.edit.post', 'uses' => 'UserController@postEdit'])->where('id', '[0-9]+');
Route::get('user/{id}/delete', ['as' => 'backend.user.delete', 'uses' => 'UserController@getDelete'])->where('id', '[0-9]+');
Route::get('user/{id}/profile', ['as' => 'backend.user.profile', 'uses' => 'UserController@getProfile'])->where('id', '[0-9]+');
Route::get('user/profile', ['as' => 'backend.user.current_profile', 'uses' => 'UserController@getProfile']);
Route::controller('user', 'UserController', ['getIndex' => 'backend.user.list', 'getCreate' => 'backend.user.create', 'postCreate' => 'backend.user.create.post']);
Route::get('role/{id}/edit', ['as' => 'backend.role.edit', 'uses' => 'RoleController@getEdit'])->where('id', '[0-9]+');
Route::post('role/{id}/edit', ['as' => 'backend.role.edit.post', 'uses' => 'RoleController@postEdit'])->where('id', '[0-9]+');
Route::get('role/{id}/delete', ['as' => 'backend.role.delete', 'uses' => 'RoleController@getDelete'])->where('id', '[0-9]+');
Route::controller('role', 'RoleController', ['getIndex' => 'backend.role.list', 'getCreate' => 'backend.role.create', 'postCreate' => 'backend.role.create.post']);
Route::controller('message', 'MessageController', ['getIndex' => 'backend.message.list', 'getCreate' => 'backend.message.create', 'postCreate' => 'backend.message.create.post', 'getRead' => 'backend.message.read']);
Route::controller('auth', 'Auth\\AuthController', ['getLogin' => 'auth.login', 'getLogout' => 'auth.logout', 'postLogin' => 'auth.login.post']);
Route::controller('password', 'Auth\\PasswordController', ['getEmail' => 'auth.password', 'postEmail' => 'auth.password.post']);
});
Route::get('/api.user.list', ['as' => 'api.user.list.get', 'uses' => 'API\\UserController@getUsers']);
Route::get('/api.user.like', ['as' => 'api.user.like.get', 'uses' => 'API\\UserController@getLike']);
Route::get('/api.user.roles', ['as' => 'api.user.roles.get', 'uses' => 'API\\UserController@getRoles']);
Route::get('/api.roles', ['as' => 'api.roles.get', 'uses' => 'API\\RoleController@getAll']);
Route::get('/api.user.meta', ['as' => 'api.user.meta.get', 'uses' => 'API\\UserMetaController@getData']);
Route::post('/api.user.meta', ['as' => 'api.user.meta.post', 'uses' => 'API\\UserMetaController@postData']);
Route::delete('/api.user.meta', ['as' => 'api.user.meta.delete', 'uses' => 'API\\UserMetaController@deleteData']);
Route::post('/api.user.message', ['as' => 'api.user.message.post', 'uses' => 'API\\UserMessageController@postMessage']);
Route::delete('/api.user.message', ['as' => 'api.user.message.delete', 'uses' => 'API\\UserMessageController@deleteMessage']);
示例7: registerMedia
public function registerMedia()
{
$this->templateScripts = ['CURRENT_URL' => $this->request->url(), 'SITE_URL' => url(), 'BASE_URL' => url(\CMS::backendPath()), 'BACKEND_PATH' => \CMS::backendPath(), 'BACKEND_RESOURCES' => \CMS::backendResourcesURL(), 'PUBLIC_URL' => url(), 'LOCALE' => \Lang::getLocale(), 'ROUTE' => $this->getRouter()->currentRouteAction(), 'ROUTE_PATH' => $this->getRouterPath(), 'USER_ID' => \Auth::id(), 'MESSAGE_ERRORS' => view()->shared('errors')->getBag('default'), 'MESSAGE_SUCCESS' => (array) $this->session->get('success', [])];
}