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


PHP View::render方法代码示例

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


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

示例1: render

 /**
  * Use this in your templates to render views returned by the controllers
  *
  * @param \Illuminate\View\View $view The view to be rendered
  */
 public static function render($view)
 {
     try {
         echo $view->render();
     } catch (\Exception $e) {
         echo $e->getMessage();
     }
 }
开发者ID:marvinlabs,项目名称:baobab,代码行数:13,代码来源:Views.php

示例2: handle

 /**
  * Publish a source file and/or pass to $next.
  *
  * @param Source $source
  * @param Closure $next
  * @param array $extensions
  * @return mixed
  */
 public function handle(Source $source, Closure $next, ...$extensions)
 {
     if ($this->isPublishable($source, $extensions)) {
         $view = new View($this->factory, $this->factory->getEngineFromPath($source->getPathname()), $this->files->get($source->getPathname()), $source->getPathname());
         $source->changeExtension(['.blade.php' => '.html'])->changeExtension(['.php' => '.html']);
         $this->write($source->getOutputPathname(), $view->render());
     }
     $next($source);
 }
开发者ID:parsnick,项目名称:steak,代码行数:17,代码来源:Compile.php

示例3: displayFields

 /**
  * Render the user fields.
  *
  * @param \WP_User|string If adding a user, $user is the context (string): 'add-existing-user' for multisite, 'add.new-user' for single. Else is a \WP_User instance.
  */
 public function displayFields($user)
 {
     // Add nonce fields for safety.
     if (!static::$hasNonce) {
         wp_nonce_field('user', '_themosisnonce');
         static::$hasNonce = true;
     }
     // Set the value attribute for each field.
     $fields = $this->setDefaultValue($user, $this->fields);
     // User view data
     $params = ['__factory' => $this, '__fields' => $fields, '__sections' => $this->sections, '__user' => $user, '__userContext' => null];
     // Check if $user is a string context
     if (is_string($user)) {
         // Set to null __user
         $params['__user'] = null;
         // Set the context
         $params['__userContext'] = $user;
     }
     // Pass data to user view.
     $this->view->with($params);
     // Render the fields.
     echo $this->view->render();
 }
开发者ID:themosis,项目名称:framework,代码行数:28,代码来源:UserFactory.php

示例4: render

 /**
  * Render the template.
  *
  * @return string
  */
 public function render()
 {
     return $this->view->render();
 }
开发者ID:ymnl007,项目名称:Clerk,代码行数:9,代码来源:BladeFactory.php

示例5: render

 /**
  * Get the string contents of the view.
  *
  * @param  callable|null $callback
  * @return string
  * @throws Exception
  * @throws Throwable
  */
 public function render(callable $callback = null)
 {
     $rendered = parent::render($callback);
     $this->factory->getDispatcher()->fire("tempTemplateRendered", $this->getName());
     return $rendered;
 }
开发者ID:vhraban,项目名称:blade-string-renderer,代码行数:14,代码来源:BladeStringView.php

示例6: render

 /**
  * Renders a Blade template with passed and stored symbol data.
  *
  * @param string $view - view name i.e.: 'sample' resolves to [template_path]/sample.blade.php
  * @param array  $data
  *
  * @return string
  */
 public function render($view, $data = [])
 {
     # resolve the view path based on the template paths and the view name
     $view = $this->view_finder->find($view);
     # collect data from the context and other places
     $data = parent::collectContext($data);
     # create an illuminate view from stored factory and blade engine
     $blade_view = new IlluminateView($this->factory, $this->blade_engine, NULL, $view, (array) $data);
     # render and return the result
     return $blade_view->render();
 }
开发者ID:anctemarry27,项目名称:cogs,代码行数:19,代码来源:BladeView.php

示例7: view

 /**
  * Takes a View and returns $this to further chain methods on.
  *
  * @param View $view
  * @return $this
  */
 public function view(View $view)
 {
     $this->markup .= $view->render();
     return $this;
 }
开发者ID:jtoler,项目名称:laravel-prince-wrapper,代码行数:11,代码来源:Prince.php

示例8: render

 /**
  * Render the metabox.
  *
  * @param array    $fields
  * @param \WP_Post $post
  */
 protected function render(array $fields, $post)
 {
     $this->view->with(['__fields' => $fields, '__metabox' => $this, '__post' => $post]);
     echo $this->view->render();
 }
开发者ID:themosis,项目名称:framework,代码行数:11,代码来源:MetaboxBuilder.php

示例9: render

 /**
  * @param string $view
  * @param array  $data
  *
  * @return string
  */
 public function render($view = NULL, array $data = []) : string
 {
     // merge existing scope with provided data array
     $this->merge($data);
     if (NULL === $view) {
         $view = $this->template;
     }
     // one way or the other, there must be a template to render
     if (NULL === $view) {
         throw new \InvalidArgumentException('No view template supplied.');
     }
     $path = $this->context->finder()->find($view);
     $blade_view = new View($this->context->factory(), $this->context->engine(), NULL, $path, $this->context->toArray());
     return $blade_view->render();
 }
开发者ID:formula9,项目名称:framework,代码行数:21,代码来源:Blade.php

示例10: displayPage

 /**
  * Triggered by the 'add_menu_page' or 'add_submenu_page'.
  */
 public function displayPage()
 {
     // Share the page instance to the view.
     $this->with('__page', $this);
     echo $this->view->render();
 }
开发者ID:themosis,项目名称:framework,代码行数:9,代码来源:PageBuilder.php


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