当前位置: 首页>>代码示例>>PHP>>正文


PHP Application::abort方法代码示例

本文整理汇总了PHP中Illuminate\Foundation\Application::abort方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::abort方法的具体用法?PHP Application::abort怎么用?PHP Application::abort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Foundation\Application的用法示例。


在下文中一共展示了Application::abort方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getReset

 public function getReset($token = null)
 {
     if (is_null($token)) {
         $this->application->abort(404);
     }
     return $this->view->make('UserManagement::password.reset')->with('token', $token);
 }
开发者ID:PhonemeCms,项目名称:cms,代码行数:7,代码来源:RemindersController.php

示例2: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure                 $next
  * @return mixed
  */
 public function handle($request, \Closure $next)
 {
     // Check if the user is logged in
     if (!$this->auth->check()) {
         // Store the current uri in the session
         $this->session->put('url.intended', $this->request->url());
         // Redirect to the login page
         return $this->redirect->route('login');
     }
     // Check if the user has access to the dashboard page
     if (!$this->auth->hasAccess('dashboard.index')) {
         // Show the insufficient permissions page
         return $this->application->abort(403);
     }
     return $next($request);
 }
开发者ID:Houbsi,项目名称:Core,代码行数:23,代码来源:AdminMiddleware.php

示例3: viewCss

 /**
  * Controller function to output the CSS.
  * 
  * @param Route $route
  * @param Request $request
  * @param Response $response
  * 
  * @return Response
  */
 public function viewCss(Route $route, Request $request, Response $response)
 {
     if (!$this->isResponseObject($response)) {
         return $response;
     }
     $files = explode(',', $route->parameter('files', ''));
     if ($route->parameter('count', 0) != count($files)) {
         $this->app->abort(422, 'Length option incorrect');
     }
 }
开发者ID:hp197,项目名称:combiner,代码行数:19,代码来源:Combiner.php

示例4: routeNeedsRoleOrPermission

 /**
  * Filters a route for role(s) and/or permission(s).
  *
  * If the third parameter is null then abort with status code 403.
  * Otherwise the $result is returned.
  *
  * @param string       $route       Route pattern. i.e: "admin/*"
  * @param array|string $roles       The role(s) needed
  * @param array|string $permissions The permission(s) needed
  * @param mixed        $result      i.e: Redirect::to('/')
  * @param bool         $requireAll  User must have all roles and permissions
  *
  * @return void
  */
 public function routeNeedsRoleOrPermission($route, $roles, $permissions, $result = null, $requireAll = false)
 {
     $filterName = is_array($roles) ? implode('_', $roles) : $roles;
     $filterName .= '_' . (is_array($permissions) ? implode('_', $permissions) : $permissions);
     $filterName .= '_' . substr(md5($route), 0, 6);
     $closure = function () use($roles, $permissions, $result, $requireAll) {
         $hasRole = $this->hasRole($roles, $requireAll);
         $hasPerms = $this->can($permissions, $requireAll);
         if ($requireAll) {
             $hasRolePerm = $hasRole && $hasPerms;
         } else {
             $hasRolePerm = $hasRole || $hasPerms;
         }
         if (!$hasRolePerm) {
             return empty($result) ? $this->app->abort(403) : $result;
         }
     };
     // Same as Route::filter, registers a new filter
     $this->app->router->filter($filterName, $closure);
     // Same as Route::when, assigns a route pattern to the
     // previously created filter.
     $this->app->router->when($route, $filterName);
 }
开发者ID:koanreview,项目名称:entrust,代码行数:37,代码来源:Entrust.php

示例5: abort

 /**
  * Throw an HttpException with the given data.
  *
  * @param int $code
  * @param string $message
  * @param array $headers
  * @return void 
  * @throws \Symfony\Component\HttpKernel\Exception\HttpException
  * @static 
  */
 public static function abort($code, $message = '', $headers = array())
 {
     \Illuminate\Foundation\Application::abort($code, $message, $headers);
 }
开发者ID:satriashp,项目名称:tour,代码行数:14,代码来源:_ide_helper.php

示例6: checkPageStatus

 /**
  *
  */
 private function checkPageStatus()
 {
     if ($this->page->is_trashed || !$this->page->is_visible || $this->page->is_hidden) {
         $this->app->abort('404');
     }
 }
开发者ID:coandacms,项目名称:coanda-core,代码行数:9,代码来源:PageRenderer.php


注:本文中的Illuminate\Foundation\Application::abort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。