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


PHP View::renderFile方法代码示例

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


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

示例1: renderFile

 public function renderFile($viewFile, $params = [], $context = null)
 {
     if ($this->theme == null) {
         $this->setTheme();
     }
     return parent::renderFile($viewFile, $params, $context);
 }
开发者ID:hucongyang,项目名称:lulucms2,代码行数:7,代码来源:BaseView.php

示例2: renderFile

 public function renderFile($viewFile, $params = [], $context = null)
 {
     $controller = Yii::$app->controller;
     if ($controller && $controller->hasMethod('getLeftMenuItems')) {
         $params['leftMenuItems'] = $controller->getLeftMenuItems();
     }
     return parent::renderFile($viewFile, $params, $context);
 }
开发者ID:remk-wadriga,项目名称:itm-yii-project,代码行数:8,代码来源:View.php

示例3: renderForm

 public function renderForm(View $view, ActiveForm $form)
 {
     return $view->renderFile('@easyii/views/seo.php', ['model' => $this->getSeoText(), 'form' => $form]);
 }
开发者ID:nanodesu88,项目名称:easyii,代码行数:4,代码来源:SeoBehavior.php

示例4: renderFile

 /**
  * Add in some controller parameters that we want to make available to all
  * views without needing to pass them explicitly
  *
  * (non-PHPdoc)
  * @see \yii\base\View::renderFile($viewFile, $params, $context)
  */
 public function renderFile($viewFile, $params = [], $context = null)
 {
     if (!$params) {
         $params = [];
     }
     if (method_exists(\Yii::$app->controller, 'getParameters')) {
         if (\Yii::$app->controller->getParameters()) {
             $params = array_merge(\Yii::$app->controller->getParameters(), $params);
         }
     }
     return parent::renderFile($viewFile, $params, $context);
 }
开发者ID:fangface,项目名称:yii2-concord,代码行数:19,代码来源:View.php

示例5: render

 /**
  * Generates code using the specified code template and parameters.
  * Note that the code template will be used as a PHP file.
  * @param string $template the code template file. This must be specified as a file path
  * relative to [[templatePath]].
  * @param array $params list of parameters to be passed to the template file.
  * @return string the generated code
  */
 public function render($template, $params = [])
 {
     $view = new View();
     $params['generator'] = $this;
     return $view->renderFile($this->getTemplatePath() . '/' . $template, $params, $this);
 }
开发者ID:Wookashlab,项目名称:MainRepo,代码行数:14,代码来源:Generator.php

示例6: getConfigFileContent

 /**
  * Returns the content of the config file that will be generated in the
  * config directory.
  * 
  * @return string the config file content
  */
 private function getConfigFileContent()
 {
     $view = new View();
     return $view->renderFile(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR . 'config.php', ['password' => $this->getRandomPassword(), 'iv' => $this->getRandomPassword(\nickcv\encrypter\components\Encrypter::IV_LENGTH)], $this);
 }
开发者ID:blacklis,项目名称:yiiserv,代码行数:11,代码来源:SetupController.php

示例7: render

 /**
  * Generates code using the specified code template and parameters.
  * Note that the code template will be used as a PHP file.
  * @param string $template the code template file. This must be specified as a file path
  * relative to [[templatePath]].
  * @param array $params list of parameters to be passed to the template file.
  * @return string the generated code
  */
 public function render($template, $params = [])
 {
     $view = new View();
     $params['generator'] = $this;
     return $view->renderFile(dirname((new \ReflectionClass($this))->getFileName()) . '/../resources/templates/' . $template, $params, $this);
 }
开发者ID:kalibao,项目名称:magesko,代码行数:14,代码来源:Generator.php

示例8: render

 /**
  * Looks in parent dir too.
  */
 public function render($template, $params = [])
 {
     $view = new View();
     $params['generator'] = $this;
     $path = $this->getTemplatePath() . '/' . $template;
     if (!file_exists($path)) {
         /// XXX quick solution, better redo
         $class = (new \ReflectionClass($this))->getParentClass();
         $dir = dirname($class->getFileName()) . '/default';
         $path = $dir . '/' . $template;
     }
     return $view->renderFile($path, $params, $this);
 }
开发者ID:hiqdev,项目名称:yii2-hiqgii,代码行数:16,代码来源:Generator.php

示例9: renderFile

 /**
  * Generates code using the specified code template and parameters.
  * Note that the code template will be used as a PHP file.
  * @param string $template the code template file. This must be specified as a file path
  * relative to [[templatePath]].
  * @param array $params list of parameters to be passed to the template file.
  * @return string the generated code
  */
 public function renderFile($file, $params = [])
 {
     $view = new View();
     $params['generator'] = $this;
     return $view->renderFile($file, $params, $this);
 }
开发者ID:dlds,项目名称:yii2-giixer,代码行数:14,代码来源:Generator.php

示例10: bcRenderCartPreview

 /**
  * Backward compatibility
  * @param Order $order
  * @param View $view
  * @param array $products
  * @return string
  */
 private static function bcRenderCartPreview(Order $order, View $view, $products = [])
 {
     return array_reduce($products, function ($result, $item) use($order, $view) {
         return $result .= $view->renderFile(ShopModule::getInstance()->getViewPath() . '/cart/item-modal-preview.php', ['order' => $order, 'orderItem' => $item['orderItem'], 'product' => $item['model']]);
     }, '');
 }
开发者ID:lzpfmh,项目名称:dotplant2,代码行数:13,代码来源:CartHandler.php

示例11: runRelations

 /**
  * @inheritdoc
  */
 public function runRelations()
 {
     $view = new View();
     foreach ($this->relations as $index => &$relation) {
         $this->findRelationName($this->tableName, $relation);
     }
     return $view->renderFile($this->migrationTemplate, ['tableName' => $this->addTablePrefix($this->tableName), 'tableNameRaw' => $this->tableNameRaw, 'fields' => $this->columns, 'classname' => $this->getMigrationName($this->prefix . $this->tableName), 'foreignKey' => $this->relations ?: [], 'db' => $this->db, 'fieldNames' => ArrayHelper::map($this->fields, 'name', 'name'), 'primaryKeys' => $this->primaryKeys]);
 }
开发者ID:infinitydevphp,项目名称:yii2-table-builder,代码行数:11,代码来源:TableBuilderTemplateMigration.php


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