當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。