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


PHP Facade::getFacadeApplication方法代码示例

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


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

示例1: getApp

 protected function getApp($service = null)
 {
     if ($service) {
         return Facade::getFacadeApplication()->make($service);
     }
     return Facade::getFacadeApplication();
 }
开发者ID:iyoworks,项目名称:support,代码行数:7,代码来源:AccessAppTrait.php

示例2: __callStatic

 public static function __callStatic($method, $args)
 {
     // subhelper
     if (empty($args)) {
         return LaravelFacade::getFacadeApplication()->helpers->subhelper($method);
     }
 }
开发者ID:adamsmeat,项目名称:helpers,代码行数:7,代码来源:HelpersFacade.php

示例3: make

 /**
  * Create a new Console application.
  *
  * @param null $app
  *
  * @return Artisan
  */
 public static function make($app = null)
 {
     if (!static::$instance) {
         /** @var Application $app */
         $app = Facade::getFacadeApplication();
         /** @var Artisan $console */
         $console = with($console = new static('Laravel Database', '4.2.*'))->setLaravel($app)->setExceptionHandler($app['exception'])->setAutoExit(false);
         $app->instance('artisan', $console);
         static::registerServiceProviders($app);
         $console->add(new AutoloadCommand());
         $console->add(new ServeCommand());
         $console->add(new ModelMakeCommand($app['files']));
         $console->add(new CommandMakeCommand($app['files']));
         $console->add(new EnvironmentCommand());
         $console->add(new EnvironmentCommand());
         static::$instance = $console;
     }
     return static::$instance;
 }
开发者ID:Alim-ifresco,项目名称:project1.dev4.why.sr,代码行数:26,代码来源:Artisan.php

示例4: isRunningWithFacades

 protected function isRunningWithFacades()
 {
     return Facade::getFacadeApplication() !== null;
 }
开发者ID:lahaxearnaud,项目名称:clockwork,代码行数:4,代码来源:ClockworkServiceProvider.php

示例5: routeNeedsRoleOrPermission

 /**
  * Filters a route for the permission. If the third parameter
  * is null then return 403. Overwise 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 needed.
  * @param mixed  $result i.e: Redirect::to('/')
  * @param bool $cumulative Must have all permissions
  *
  * @access public
  *
  * @return void
  */
 public function routeNeedsRoleOrPermission($route, $roles, $permissions, $result = null, $cumulative = false)
 {
     if (!is_array($roles)) {
         $roles = array($roles);
     }
     if (!is_array($permissions)) {
         $permissions = array($permissions);
     }
     $filter_name = implode('_', $roles) . '_' . implode('_', $permissions) . '_' . substr(md5($route), 0, 6);
     if (!$result instanceof Closure) {
         $result = function () use($roles, $permissions, $result, $cumulative) {
             $hasARole = array();
             foreach ($roles as $role) {
                 if ($this->hasRole($role)) {
                     $hasARole[] = true;
                 } else {
                     $hasARole[] = false;
                 }
             }
             $hasAPermission = array();
             foreach ($permissions as $permission) {
                 if ($this->can($permission)) {
                     $hasAPermission[] = true;
                 } else {
                     $hasAPermission[] = false;
                 }
             }
             // Check to see if it is false and then
             // check additive flag and that the array only contains false.
             if ((in_array(false, $hasARole) || in_array(false, $hasAPermission)) && ($cumulative || count(array_unique(array_merge($hasARole, $hasAPermission))) == 1)) {
                 if (!$result) {
                     Facade::getFacadeApplication()->abort(403);
                 }
                 return $result;
             }
         };
     }
     // Same as Route::filter, registers a new filter
     $this->_app['router']->filter($filter_name, $result);
     // Same as Route::when, assigns a route pattern to the
     // previously created filter.
     $this->_app['router']->when($route, $filter_name);
 }
开发者ID:ajgallego,项目名称:laravel-helpers,代码行数:57,代码来源:Entrust.php

示例6: view

 /**
  * Return a new view response from the application.
  *
  * @param  string  $view
  * @param  array   $data
  * @param  int     $status
  * @param  array   $headers
  * @return \Illuminate\Http\Response
  */
 public static function view($view, $data = array(), $status = 200, array $headers = array())
 {
     $app = Facade::getFacadeApplication();
     return static::make($app['view']->make($view, $data), $status, $headers);
 }
开发者ID:shubhomoy,项目名称:evolve,代码行数:14,代码来源:Response.php

示例7: testServiceProvider

 public function testServiceProvider()
 {
     $this->assertCount(3, Facade::getFacadeApplication()->getLoadedProviders());
 }
开发者ID:neerajgoyal12,项目名称:laravel-stapler,代码行数:4,代码来源:TestCase.php


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