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


PHP Controller::getViewPath方法代码示例

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


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

示例1: getViewPath

 /**
  * Override the default Yii controller getViewPath method. To define the template folders in where
  * the templates are located. Why? Basically some modules needs to put theyr templates inside of the client
  * repository.
  *
  * @return string
  */
 public function getViewPath()
 {
     if ($this->module instanceof Module && $this->module->useAppViewPath) {
         return '@app/views/' . $this->module->id . '/' . $this->id;
     }
     return parent::getViewPath();
 }
开发者ID:luyadev,项目名称:luya-core,代码行数:14,代码来源:Controller.php

示例2: getViewPath

 public function getViewPath()
 {
     $module = $this->module->id;
     if ($module === Yii::$app->id) {
         return parent::getViewPath();
     }
     return Yii::getAlias('@app') . '/views/' . $module . '/' . $this->id;
 }
开发者ID:remk-wadriga,项目名称:itm-yii-project,代码行数:8,代码来源:ControllerAbstract.php

示例3: getViewPath

 public function getViewPath()
 {
     if (!isset($this->viewPathOverride)) {
         return parent::getViewPath();
     } else {
         return $this->viewPathOverride . DIRECTORY_SEPARATOR . $this->id;
     }
 }
开发者ID:nkostadinov,项目名称:yii2-user,代码行数:8,代码来源:BaseController.php

示例4: getViewPath

 /**
  * Override the default Yii controller getViewPath method. To define the template folders in where
  * the templates are located. Why? Basically some modules needs to put theyr templates inside of the client
  * repository.
  *
  * @return string
  */
 public function getViewPath()
 {
     // if the module settings is turn to use the module view path we use them always first!
     if ($this->module->controllerUseModuleViewPath !== null) {
         $this->useModuleViewPath = $this->module->controllerUseModuleViewPath;
     }
     // use default yii behaviour
     if ($this->useModuleViewPath) {
         return parent::getViewPath();
     }
     // use client repository specific path
     return '@app/views/' . $this->module->id . '/' . $this->id;
 }
开发者ID:krystian-thiede,项目名称:luya,代码行数:20,代码来源:Controller.php

示例5: render

 public function render($view, $params = [])
 {
     $devicedetect = \Yii::$app->devicedetect;
     $isMobile = $devicedetect->isMobile();
     $isTablet = $devicedetect->isTablet();
     $mobileTpl = $isMobile && !$isTablet;
     // detect and change layout
     if ($mobileTpl) {
         $this->layout = '@app/views/layouts/sp_main';
     }
     // detect and render view
     $detectView = $view . ($mobileTpl ? '_sp' : '');
     $detectPath = parent::getViewPath() . "/{$detectView}.php";
     return parent::render(file_exists($detectPath) ? $detectView : $view, $params);
 }
开发者ID:kaihatsusha,项目名称:kpimon,代码行数:15,代码来源:MobiledetectController.php

示例6: getViewPath

 /**
  * Get view path based on module property
  *
  * @return string
  */
 public function getViewPath()
 {
     return Yii::$app->getModule('user')->viewPath ? rtrim(Yii::$app->getModule('user')->viewPath, '/\\') . DIRECTORY_SEPARATOR . $this->id : parent::getViewPath();
 }
开发者ID:filsh,项目名称:yii2-user,代码行数:9,代码来源:DefaultController.php

示例7: getViewPath

 /**
  * Get view path based on module property
  * @return string
  */
 public function getViewPath()
 {
     return Yii::$app->getModule("golfteamplanner")->viewPath ? rtrim(Yii::$app->getModule("golfteamplanner")->viewPath, "/\\") . DIRECTORY_SEPARATOR . $this->id : parent::getViewPath();
 }
开发者ID:frenzelgmbh,项目名称:golfteamplanner,代码行数:8,代码来源:HandycapController.php

示例8: getViewPath

 public function getViewPath()
 {
     if ($this->getCart()->module->viewPath) {
         return Yii::getAlias($this->getCart()->module->viewPath . DIRECTORY_SEPARATOR . 'cart');
     }
     return parent::getViewPath();
 }
开发者ID:hiqdev,项目名称:yii2-cart,代码行数:7,代码来源:CartController.php


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