fecshop_local.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. // 本文件在app/web/index.php 处引入。
  3. // fecshop的核心模块
  4. $modules = [];
  5. foreach (glob(__DIR__.'/fecshop_local_modules/*.php') as $filename) {
  6. $modules = array_merge($modules, require($filename));
  7. }
  8. // services
  9. $services = [];
  10. foreach (glob(__DIR__.'/fecshop_local_services/*.php') as $filename) {
  11. $services = array_merge($services, require($filename));
  12. }
  13. // 组件
  14. $components = [
  15. 'i18n' => [
  16. 'translations' => [
  17. 'appfront' => [
  18. 'basePaths' => [
  19. '@appfront/languages',
  20. ],
  21. // base language code
  22. 'sourceLanguage' => 'en_US',
  23. /**
  24. * @var bool whether to force message translation when the source and target languages are the same.
  25. * Defaults to false, meaning translation is only performed when source and target languages are different.
  26. * see: @yii/i18n/MessageSource.php @property $forceTranslation
  27. */
  28. 'forceTranslation' => true,
  29. ],
  30. ],
  31. ],
  32. ];
  33. // param
  34. $params = [];
  35. /**
  36. * Yii框架的class rewrite重写,这个一般不用,您可以通过这个重写基本上任何的class,但是这种方式是替换,重写的class无法继承原来的class,因此是替换的方式重写
  37. * Yii framework class rewrite: 文档:http://www.fecmall.com/doc/fecshop-guide/develop/cn-2.0/guide-fecmall-rewrite-func.html#7yii2classclassmapfecmall
  38. */
  39. $yiiClassMap = [
  40. // 下面是一个重写的格式例子
  41. // 'fecshop\app\apphtml5\helper\test\My' => '@apphtml5/helper/My.php'
  42. ];
  43. /**
  44. * Fecmall model 和 block 重写,可以在RewriteMap中配置
  45. * 文档地址:http://www.fecmall.com/doc/fecshop-guide/develop/cn-2.0/guide-fecmall-rewrite-func.html#8rewritemapblock-model
  46. */
  47. $fecRewriteMap = [
  48. // 下面是一个重写的格式例子
  49. // '\fecshop\app\appfront\modules\Cms\block\home\Index' => '\fectfurnilife\appfront\modules\Cms\block\home\Index',
  50. ];
  51. return [
  52. 'modules' => $modules,
  53. 'services' => $services,
  54. 'components' => $components,
  55. 'params' => $params,
  56. 'yiiClassMap' => $yiiClassMap,
  57. 'fecRewriteMap' => $fecRewriteMap,
  58. ];