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


PHP Factory::with方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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


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