fecmall 应用扩展配置文件示例

技术分享 · Fecmall · 于 7天前 发布 · 30 次阅读

fecmall 应用扩展配置文件示例

fecmall的所有的模板,插件,系统,都是再fecmall基础上,进行的扩展,并不会改动fecmall代码 ,也就是说,无论后续做多少fecmall的插件系统,fecmall的代码并不会改动,都独立的。

<?php
/**
 * Fecmall Addons Config File
 */

// set namespace alisa
Yii::setAlias('@fecyo', dirname(dirname(dirname(__DIR__))).'/addons/fecmall/fecyo/');

return [
    // 插件信息
    'info'  => [
        'name' => 'fecyo',
        'author' => 'Fecmall',
    ],
    // 插件管理部分
    'administer' => [
        'install' => [
            'class' => 'fecyo\administer\Install',
            // 其他引入的属性,类似yii2组件的方式写入即可
            'test' => 'test_data',
        ],
        'upgrade' => [
            'class' => 'fecyo\administer\Upgrade',
        ],
        'uninstall' => [
            'class' => 'fecyo\administer\Uninstall',
        ],
    ], 
    // 各个入口的配置
    'app' => [
        // 公共层部分配置
        'common' => [
            'enable' => true,
            // 公用层的具体配置下载下面
            'config' => [
                'services' => [
                    //'cart' => [
                    //    'class' => 'fecshop\rediscart\services\Cart',
                    //    'childService' => [
                    //        'quote' => [
                    //            'class' => 'fecshop\rediscart\services\cart\Quote',
                    //        ],
                    //        'quoteItem' => [
                    //            'class' => 'fecshop\rediscart\services\cart\QuoteItem',
                    //        ],
                    //    ]
                    //]
                    
                    'category' => [
                        'class' => 'fecyo\services\Category',
                    ],
                ],
            ]
        ],
        // 1.appfront层
        'appfront' => [
            // appfront入口的开关,如果false,则会失效
            'enable' => true,
            'config' => [
                // yii class rewrite map
                'yiiClassMap' => [
                    // 'fecshop\app\appfront\helper\test\My' => '@appfront/helper/My.php',
                ],
                // 重写model和block
                'fecRewriteMap' => [
                    '\fecshop\app\appfront\modules\Catalog\block\category\Index'  => '\fecyo\app\appfront\modules\Catalog\block\category\Index',
                    // '\fecshop\app\appfront\modules\Customer\block\address\Edit'  => '\fectb\app\appfront\modules\Customer\block\address\Edit',
                ],
                'modules' => [
                    //'checkout' => [
                    //    'controllerMap' => [
                    //        'cartinfo' => 'fectfurnilife\app\appfront\modules\Checkout\controllers\CartInfoController',          
                    //    ],
                    //],
                ],
                'components' => [
                    // yii2 语言组件配置,关于Yii2国际化,可以参看:http://www.yiichina.com/doc/guide/2.0/tutorial-i18n
                    'i18n' => [
                        'translations' => [
                            'appfront' => [
                                'basePaths' => [
                                    '@fecyo/app/appfront/languages',
                                ],
                            ],
                        ],
                    ],
                ],
                'modules' => [
                    'customer' => [
                        'controllerMap' => [
                            'account' => 'fecyo\app\appfront\modules\Customer\controllers\AccountController',       
                            'editaccount' => 'fecyo\app\appfront\modules\Customer\controllers\EditaccountController',      
                            'coupon' => 'fecyo\app\appfront\modules\Customer\controllers\CouponController',      
                            'address' => 'fecyo\app\appfront\modules\Customer\controllers\AddressController',      
                            'order' => 'fecyo\app\appfront\modules\Customer\controllers\OrderController',      
                        ], 
                    ],
                    'catalog' => [
                        'controllerMap' => [
                            'reviewproduct' => 'fecyo\app\appfront\modules\Catalog\controllers\ReviewproductController',  
                        ],
                    ],
                    'cms' => [
                        'controllerMap' => [
                            'home' => 'fecyo\app\appfront\modules\Cms\controllers\HomeController',  
                        ],
                    ],
                    'catalogsearch' => [
                        'controllerMap' => [
                            'index' => 'fecyo\app\appfront\modules\Catalogsearch\controllers\IndexController',  
                        ],
                    ],
                ],
                'services' => [
                    'page' => [
                        'childService' => [
                            'widget' => [
                                'widgetConfig' => [
                                    'base' => [
                                        'header_mini' => [
                                            'class' => 'fecshop\app\appfront\widgets\Headers',
                                            // 根据多模板的优先级,依次去模板找查找该文件,直到找到这个文件。
                                            'view'  => 'widgets/header_mini.php',
                                            'cache' => [
                                                'timeout'    => 4500,
                                            ],
                                        ],
                                    ],
                                ],
                            ],
                            'menu' => [
                                'behindCustomMenu' => [
                                    [
                                        'name'        => 'Fetch Coupon',            // 菜单名字
                                        'urlPath'     => '/coupon/fetch/lists',    
                                    ],
                                    [
                                        'name'        => 'Newcomer Gift',            // 菜单名字
                                        'urlPath'     => '/coupon/customer/registergift',    
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        // html5入口
        'apphtml5' =>[],
        // appserver入口(vue 微信小程序等api)
        'appserver' =>[],
        // appapi入口,和第三方交互的api
        'appapi' =>[],
        // 后台部分
        'appadmin' =>[
            'enable' => true,
            'config' => [
                'modules' => [
                    'config' => [ // sales 模块
                        'controllerMap' => [
                            'fecyo' => 'fecyo\app\appadmin\modules\Config\controllers\FecyoController',
                        ],
                    ],
                ],
                'components' => [
                    // yii2 语言组件配置,关于Yii2国际化,可以参看:http://www.yiichina.com/doc/guide/2.0/tutorial-i18n
                    'i18n' => [
                        'translations' => [
                            'appadmin' => [
                                'basePaths' => [
                                    '@fecyo/app/appadmin/languages',
                                ],
                            ],
                        ],
                    ],
                ],
                'services' => [
                    'admin' => [
                        'childService' => [
                            'urlKey' => [
                                'urlKeyTags' => [
                                    'sales_order_process' => 'Sales-Order-Process',
                                    'config_fecyo_manager' => 'Config-Fecyo',
                                ],
                            ],
                            'menu' => [
                                'menuConfig' => [
                                    'config' => [
                                        'child' => [
                                            'services' => [
                                                'child' => [
                                                    'fecyo_manager' => [
                                                        'label' => 'Fecyo Config',
                                                        'url_key' => '/config/fecyo/manager',
                                                    ],
                                                ],
                                            ],
                                        ],
                                    ], 
                                ],
                            ],
                        ],
                    ],
                    'page' => [
                        'childService' => [
                            'theme' => [
                                // 指定view文件的绝对路径,指定后,将不走多模板路径
                                'viewFileConfig' => [
                                    'config/fecyo/manager' => '@fecyo/app/appadmin/theme/config/fecyo/manager.php',
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        // console,命令行脚本端
        'console' =>[],
    ],
    
    
];
共收到 0 条回复
没有找到数据。
添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics