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


PHP Factory::composer方法代码示例

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


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

示例1: init

 /**
  * Controller init.
  * @param Backend $backend
  * @param ViewFactory $view
  */
 public function init(Backend $backend, ViewFactory $view)
 {
     $backend->setActiveMenu('system.users');
     $view->composer($this->viewName('users.form'), function (View $view) {
         $view->with('groups', GroupModel::query()->get());
     });
 }
开发者ID:rabbitcms,项目名称:backend,代码行数:12,代码来源:Users.php

示例2: init

 /**
  * Init controller.
  * @param Backend $backend
  * @param ViewFactory $view
  */
 public function init(Backend $backend, ViewFactory $view)
 {
     $backend->setActiveMenu('system.groups');
     $view->composer($this->viewName('groups.form'), function (View $view) use($backend) {
         $view->with('rules', $backend->getAclGroups());
     });
 }
开发者ID:rabbitcms,项目名称:backend,代码行数:12,代码来源:Groups.php

示例3: make

 /**
  * Create a new menu instance.
  *
  * @param  string    $name
  * @param  callable  $callback
  * @return \C5\AppKit\Menus\Builder
  */
 public function make($name, $callback, $share = null)
 {
     if (is_callable($callback)) {
         $menu = new Builder($name, $this->loadConfig($name), $this->html, $this->url);
         call_user_func($callback, $menu);
         $this->collection->put($name, $menu);
         if ($share != null) {
             $this->view->composer($share, function ($view) use($name, $menu) {
                 $view->with($name, $menu);
             });
         } else {
             $this->view->composer($name, $menu);
         }
         return $menu;
     }
 }
开发者ID:cloud5ideas,项目名称:appkit,代码行数:23,代码来源:Menu.php

示例4: composer

 /**
  * Register a view composer to current theme.
  *
  * @param string|array    $views
  * @param string|callable $callback
  * @param int|null        $priority
  */
 public function composer($views, $callback, $priority = null)
 {
     $theViews = [];
     foreach ((array) $views as $view) {
         $theViews[] = $this->getThemeNamespace($view);
     }
     $this->views->composer($theViews, $callback, $priority);
 }
开发者ID:sonus,项目名称:themes,代码行数:15,代码来源:Repository.php

示例5: handle

 /**
  * Handle the command.
  *
  * @param Application $application
  * @param Factory $views
  */
 public function handle(Application $application, Factory $views)
 {
     $views->composer('*', 'Anomaly\\Streams\\Platform\\View\\ViewComposer');
     $views->addNamespace('streams', __DIR__ . '/../../../resources/views');
     $views->addNamespace('resources', base_path('resources/views'));
     $views->addNamespace('storage', $application->getStoragePath());
     $views->addNamespace('app', $application->getResourcesPath());
     $views->addNamespace('root', base_path());
     $views->addExtension('html', 'php');
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:16,代码来源:AddViewNamespaces.php

示例6: postEmail

 /**
  * Send a reset link to the given user.
  *
  * @param  EmailPasswordLinkRequest  $request
  * @param  Illuminate\View\Factory $view
  * @return Response
  */
 public function postEmail(EmailPasswordLinkRequest $request, Factory $view)
 {
     $view->composer('emails.auth.password', function ($view) {
         $view->with(['title' => trans('front/password.email-title'), 'intro' => trans('front/password.email-intro'), 'link' => trans('front/password.email-link'), 'expire' => trans('front/password.email-expire'), 'minutes' => trans('front/password.minutes')]);
     });
     switch ($response = $this->passwords->sendResetLink($request->only('email'), function ($message) {
         $message->subject(trans('front/password.reset'));
     })) {
         case PasswordBroker::RESET_LINK_SENT:
             return redirect()->back()->with('status', trans($response));
         case PasswordBroker::INVALID_USER:
             return redirect()->back()->with('error', trans($response));
     }
 }
开发者ID:arman-interpiar,项目名称:laravel5-example,代码行数:21,代码来源:PasswordController.php

示例7: postEmail

 /**
  * Send a reset link to the given user.
  *
  * @param  EmailPasswordLinkRequest  $request
  * @param  Illuminate\View\Factory $view
  * @return Response
  */
 public function postEmail(Factory $view)
 {
     $request = Request::all();
     $view->composer('emails.auth.password', function ($view) {
         $view->with(['title' => trans('front/password.email-title'), 'intro' => trans('front/password.email-intro'), 'link' => trans('front/password.email-link'), 'expire' => trans('front/password.email-expire'), 'minutes' => trans('front/password.minutes')]);
     });
     $response = Password::sendResetLink(['email' => $request['email']], function (Message $message) {
         $message->subject(trans('front/password.reset'));
     });
     switch ($response) {
         case Password::RESET_LINK_SENT:
             return redirect()->back()->with('status', trans($response));
         case Password::INVALID_USER:
             return redirect()->back()->with('error', trans($response));
     }
 }
开发者ID:jhuhandha,项目名称:lblog,代码行数:23,代码来源:PasswordController.php

示例8: partialComposer

 /**
  * Hook a partial before rendering.
  *
  * @param  mixed $view
  * @param  closure $callback
  * @return void
  */
 public function partialComposer($view, $callback, $layout = null)
 {
     $partialDir = $this->getConfig('containerDir.partial');
     if (!is_array($view)) {
         $view = array($view);
     }
     // Partial path with namespace.
     $path = $this->getThemeNamespace($partialDir);
     // This code support partialWithLayout.
     if (!is_null($layout)) {
         $path = $path . '.' . $layout;
     }
     $view = array_map(function ($v) use($path) {
         return $path . '.' . $v;
     }, $view);
     $this->view->composer($view, $callback);
 }
开发者ID:fajardm,项目名称:theme-manager,代码行数:24,代码来源:Theme.php

示例9: composer

 /**
  * Register a view composer event.
  *
  * @param array|string $views
  * @param \Closure|string $callback
  * @param int|null $priority
  * @return array 
  * @static 
  */
 public static function composer($views, $callback, $priority = null)
 {
     return \Illuminate\View\Factory::composer($views, $callback, $priority);
 }
开发者ID:satriashp,项目名称:tour,代码行数:13,代码来源:_ide_helper.php

示例10: registerViewComposers

 /**
  * Registers the view composers for this package
  */
 private function registerViewComposers()
 {
     $this->view->composer('auth::*', 'Ipunkt\\Auth\\Composers\\ConfigComposer');
 }
开发者ID:ipunkt,项目名称:auth,代码行数:7,代码来源:AuthServiceProvider.php


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