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


PHP Factory::make方法代码示例

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


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

示例1: render

 /**
  * @param Request $request
  * @param array $routeParams
  * @return \Psr\Http\Message\ResponseInterface|EmptyResponse
  */
 public function render(Request $request, array $routeParams = [])
 {
     $view = $this->view->make('flarum.install::app');
     $view->logo = $this->view->make('flarum.install::logo');
     $errors = [];
     if (version_compare(PHP_VERSION, '5.5.0', '<')) {
         $errors[] = ['message' => '<strong>PHP 5.5+</strong> is required.', 'detail' => 'You are running version ' . PHP_VERSION . '. Talk to your hosting provider about upgrading to the latest PHP version.'];
     }
     foreach (['mbstring', 'pdo_mysql', 'openssl', 'json', 'gd', 'dom'] as $extension) {
         if (!extension_loaded($extension)) {
             $errors[] = ['message' => 'The <strong>' . $extension . '</strong> extension is required.'];
         }
     }
     $paths = [public_path(), public_path() . '/assets', storage_path()];
     foreach ($paths as $path) {
         if (!is_writable($path)) {
             $errors[] = ['message' => 'The <strong>' . realpath($path) . '</strong> directory is not writable.', 'detail' => 'Please chmod this directory ' . ($path !== public_path() ? ' and its contents' : '') . ' to 0775.'];
         }
     }
     if (count($errors)) {
         $view->content = $this->view->make('flarum.install::errors');
         $view->content->errors = $errors;
     } else {
         $view->content = $this->view->make('flarum.install::install');
     }
     return $view;
 }
开发者ID:utkarshx,项目名称:core,代码行数:32,代码来源:IndexAction.php

示例2: render

 /**
  * @param Append $append
  *
  * @return \Illuminate\Contracts\View\View
  */
 public function render(Append $append, $prefix = 'sidebar')
 {
     $this->view = $prefix . '::' . $this->view;
     if ($append->isAuthorized()) {
         return $this->factory->make($this->view, ['append' => $append])->render();
     }
 }
开发者ID:fordongu,项目名称:maigc-menubar,代码行数:12,代码来源:IlluminateAppendRenderer.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->app->isDownForMaintenance()) {
         return new Response($this->view->make('maintenance')->render(), 503);
     }
     return $next($request);
 }
开发者ID:berkapavel,项目名称:CMS,代码行数:15,代码来源:CheckForMaintenanceMode.php

示例4: menu

 public function menu($items)
 {
     if (!is_array($items)) {
         $items = $this->config->get($items, array());
     }
     return $this->view->make('partials/menu', compact('items'));
 }
开发者ID:resand,项目名称:teachme,代码行数:7,代码来源:HtmlBuilder.php

示例5: handle

 /**
  * @param LoadPageViewIndexCommand $command
  * @return \Anomaly\FizlPages\Page\Contract\Page
  */
 public function handle(LoadPageViewIndexCommand $command)
 {
     $page = $command->getPage();
     $page->setView($this->factory->make($page->getIndexPath()));
     $page->raise(new PageViewIndexLoaded($page));
     return $page;
 }
开发者ID:hscale,项目名称:fizl-pages,代码行数:11,代码来源:LoadPageViewIndexCommandHandler.php

示例6: renderer

 /**
  * Render the breadcrumbs view.
  *
  * @param $view
  * @param $breadcrumbs
  * @return string
  * @throws Exception
  */
 public function renderer($view, $breadcrumbs)
 {
     if (!is_null($view)) {
         return $this->master->make($view, compact('breadcrumbs'))->render();
     }
     throw new Exception('Breadcrumbs view not specified (check the view in config/breadcrumbs.php, and ensure DaveJamesMiller\\Breadcrumbs\\ServiceProvider is loaded before any dependants in config/app.php)');
 }
开发者ID:cskonline,项目名称:creation,代码行数:15,代码来源:View.php

示例7: execute

 /**
  * {@inheritdoc}
  */
 public function execute($request)
 {
     /** @var $request ObtainCreditCard */
     if (false == $this->supports($request)) {
         throw RequestNotSupportedException::createActionNotSupported($this, $request);
     }
     if ($this->request->isMethod('POST')) {
         $creditCard = new CreditCard();
         $creditCard->setHolder($this->request->get('card_holder'));
         $creditCard->setNumber($this->request->get('card_number'));
         $creditCard->setSecurityCode($this->request->get('card_cvv'));
         $creditCard->setExpireAt(new DateTime($this->request->get('card_expire_at')));
         $request->set($creditCard);
         return;
     }
     $form = $this->viewFactory->make($this->templateName, ['model' => $request->getModel(), 'firstModel' => $request->getFirstModel(), 'actionUrl' => $request->getToken() ? $request->getToken()->getTargetUrl() : null]);
     throw new HttpResponse(new Response($form->render(), 200, ['Cache-Control' => 'no-store, no-cache, max-age=0, post-check=0, pre-check=0', 'X-Status-Code' => 200, 'Pragma' => 'no-cache']));
     /*
         $content = $this->viewFactory->make($this->templateName, [
             'model'      => $request->getModel(),
             'firstModel' => $request->getFirstModel(),
             'form'       => $form->render(),
             'actionUrl'  => $request->getToken() ? $request->getToken()->getTargetUrl() : null,
         ]);
     
         $this->gateway->execute($renderTemplate);
     
         throw new HttpResponse(new Response($renderTemplate->getResult(), 200, [
             'Cache-Control' => 'no-store, no-cache, max-age=0, post-check=0, pre-check=0',
             'X-Status-Code' => 200,
             'Pragma'        => 'no-cache',
         ]));
     */
 }
开发者ID:recca0120,项目名称:laravel-payum,代码行数:37,代码来源:ObtainCreditCardAction.php

示例8: fire

 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $this->registerClassAutoloadExceptions();
     $bindings = array();
     foreach ($this->getAbstracts() as $abstract) {
         // Validator and seeder cause problems
         if (in_array($abstract, ['validator', 'seeder'])) {
             continue;
         }
         try {
             $concrete = $this->laravel->make($abstract);
             if (is_object($concrete)) {
                 $class = get_class($concrete);
                 if (strpos($class, 'Proxy_') === 0) {
                     $class = get_parent_class($class);
                 }
                 $bindings[$abstract] = $class;
             }
         } catch (\Exception $e) {
             if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {
                 $this->comment("Cannot make '{$abstract}': " . $e->getMessage());
             }
         }
     }
     $content = $this->view->make('ide-helper::meta', ['bindings' => $bindings, 'methods' => $this->methods])->render();
     $filename = $this->option('filename');
     $written = $this->files->put($filename, $content);
     if ($written !== false) {
         $this->info("A new meta file was written to {$filename}");
     } else {
         $this->error("The meta file could not be created at {$filename}");
     }
 }
开发者ID:khongchi,项目名称:xpressengine-ide-helper,代码行数:38,代码来源:MetaCommand.php

示例9: generate

 public function generate()
 {
     $files = $this->documentation->getAllFiles();
     $view = $this->viewFactory->make('documentation::route_templates.routes', compact('files'));
     $filePath = storage_path() . "/routes/documentation_routes.php";
     $fileContents = "<?php\n\n" . $view->render();
     $this->finder->put($filePath, $fileContents);
 }
开发者ID:Houbsi,项目名称:Website,代码行数:8,代码来源:DocumentationRoutesGenerator.php

示例10: viewAction

 /**
  * @param int    $tagId
  * @param string $tagName
  *
  * @throws \Illuminate\Database\Eloquent\ModelNotFoundException
  *
  * @return \Illuminate\Contracts\View\View|\Illuminate\Http\RedirectResponse
  */
 public function viewAction(int $tagId, string $tagName)
 {
     $tag = $this->tagRepository->loadById($tagId);
     if ($tag->name !== $tagName) {
         return $this->responseFactory->redirectToRoute('tag.view', ['id' => $tag->id, $tag->name]);
     }
     return $this->viewFactory->make('customer.tag.view', compact('tag'));
 }
开发者ID:hughgrigg,项目名称:ching-shop,代码行数:16,代码来源:TagController.php

示例11: handle

 /**
  * @param LoadPageView404Command $command
  * @return Page
  */
 public function handle(LoadPageView404Command $command)
 {
     $page = $command->getPage();
     $page->setView($this->factory->make($page->getMissingPath()));
     $page->setMissing(true);
     $page->raise(new PageView404Loaded($page));
     return $page;
 }
开发者ID:hscale,项目名称:fizl-pages,代码行数:12,代码来源:LoadPageView404CommandHandler.php

示例12: render

 /**
  * Render an exception into an HTTP response.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Exception               $e
  *
  * @return \Illuminate\Http\Response
  */
 public function render($request, Exception $e)
 {
     if ($e instanceof HttpException) {
         if ($this->view->exists('errors.' . $e->getStatusCode())) {
             return $this->view->make('errors.' . $e->getStatusCode(), ['request' => $request, 'exception' => $e]);
         }
     }
     return parent::render($request, $e);
 }
开发者ID:systemovich,项目名称:laraveldoctrine.org,代码行数:17,代码来源:Handler.php

示例13: render

 /**
  * @param Request $request
  * @param array $routeParams
  * @return \Illuminate\Contracts\View\View
  */
 public function render(Request $request, array $routeParams = [])
 {
     $token = array_get($routeParams, 'token');
     $token = PasswordToken::findOrFail($token);
     if ($token->created_at < new DateTime('-1 day')) {
         throw new InvalidConfirmationTokenException();
     }
     return $this->view->make('flarum::reset')->with('token', $token->id);
 }
开发者ID:redstarxz,项目名称:flarumone,代码行数:14,代码来源:ResetPasswordAction.php

示例14: render

 /**
  * @param Request $request
  * @return \Illuminate\Contracts\View\View
  * @throws InvalidConfirmationTokenException
  */
 public function render(Request $request)
 {
     $token = array_get($request->getQueryParams(), 'token');
     $token = PasswordToken::findOrFail($token);
     if ($token->created_at < new DateTime('-1 day')) {
         throw new InvalidConfirmationTokenException();
     }
     return $this->view->make('flarum::reset')->with('translator', $this->translator)->with('passwordToken', $token->id)->with('csrfToken', $request->getAttribute('session')->get('csrf_token'));
 }
开发者ID:Luceos,项目名称:core,代码行数:14,代码来源:ResetPasswordController.php

示例15: get

 /**
  * Returns the cached view
  *
  * @param  string     $view
  * @param  mixed|null $data
  * @param  mixed|null $prefix
  * @param  mixed|null $tags
  *
  * @return string
  */
 public function get($view, $data = null, $prefix = null, $tags = null)
 {
     $key = $this->makeKey($view, (array) $data, (array) $prefix);
     if (!$this->shouldCache) {
         return $this->view->make($view, $data)->render();
     }
     return $this->getCache((array) $tags)->rememberForever($key, function () use($view, $data) {
         return $this->view->make($view, (array) $data)->render();
     });
 }
开发者ID:rodrigopedra,项目名称:russian-doll-caching,代码行数:20,代码来源:RussianDollCaching.php


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