@Fecshop [#7楼](#comment7) 对fecshop还不熟,请多指教:
mongodb和theme部分已重写,检查没问题。直接在@fecshop下的fecshop\app\appfront\modules\Catalog\block\product\Index.php增加
'url_referee' => $this->_product['url_referee'],
没有问题,能取到数据并正常显示到页面。
现在把Index.php文件复制到appfront\local\local_modules\Catalog\block\product下编辑:
namespace appfront\local\local_modules\Catalog\block\product;
...
...
'url_referee' => $this->_product['url_referee'],
,url_referee没有返回值,也没报错。
YiiRewriteMap:
return [
/**
* \fecshop\models\mongodb\Category 为原来的类
* \appfront\local\local_models\mongodb\Category 为重写后的类
* 重写后的类可以集成原来的类。
*/
'\fecshop\models\mongodb\Category' => '\appfront\local\local_models\mongodb\Category',
'\fecshop\models\mongodb\Product' => '\appfront\local\local_models\mongodb\Product',
'\fecshop\app\appfront\modules\Catalog\block\product' => '\appfront\local\local_modules\Catalog\block\product',
// '\fecshop\app\appfront\modules\Cms\block\home\Index' => '\appfront\local\local_modules\Cms\block\home\Index',
// '\fecshop\app\appfront\modules\Catalog\block\product\CustomOption' => '\appfront\local\local_modules\Catalog\block\product\CustomOption',
];
我是不是漏步骤了?