php - yii - 如何在模块中对小部件进行主题化

标签 php yii

我的目录结构如下:

   .
   |-config
   |-modules
   |---articles
   |---catalog
   |-----components
   |-----controllers
   |-----fixtures
   |-----migrations
   |-----models
   |-----views
   |-----widgets <----------------- MY WIDGETS
   |------ FooWidget.php
   |-------views
   |--------- foo.php <--- default view, not working
   |-runtime
   |-tests
   |-themes
   |---XXXX
   |-----assets
   |-----views
   |-------catalog <--------------- MODULE VIEWS
   |-------layouts
   |-------widgets
   |-views
   |-widgets

我调用 $this->widget('application.modules.catalog.widgets.FooWidget') - 并捕获异常 CException - 未找到 View 。 如何在模块内对小部件进行主题化?

最佳答案

根据manual 您的小部件 View 应位于 /themes/XXXX/views/FooWidget/foo.php 中。

关于php - yii - 如何在模块中对小部件进行主题化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16587015/

相关文章:

PHP 在按位运算中的 Infinit 值返回奇怪的值

php - 获取 20 个最频繁的数字对 (2/2) 和三元组 (3/3)

php - Web 应用程序 : to framework or not to framework?

php - Yii Joined table 但不是所有选定的数据都被检索

php - Yii - 'white screen of death',调试提示

javascript - MySQL 错误号 1064

php - 使用 PHP 从 C 应用程序的 STDOUT 读取数据

javascript - Yii::app()->user->getState 在从 javascript 重定向 url 后无法正常工作

php - fatal error : Call to a member function getDbCriteria() on a non-object

php - CGridView 分页不起作用。伊伊