快速搭建codeigniter3.0和extjs5.0开发平台

步骤1:           
在CodeIgniter项目目录下面用sencha生成extjs5项目           
$sencha generate app HRM ./HRM           
           
           
步骤2: 修改bootstrap.js文件下面两个地方           
修改1:           
            run: function() {           
                Microloader.init();           
                var manifest = Ext.manifest;           
           
                if (typeof manifest === "string") {           
                    var extension = ".json",           
                        url = manifest.indexOf(extension) === manifest.length - extension.length           
                            ? manifest           
                            : manifest + ".json";           
           
   url = Boot.baseUrl + url;        
   //console.log('json路径:', url);         
           
                    Boot.fetch(url, function(result){           
                        manifest = Ext.manifest = JSON.parse(result.content);           
                        Microloader.load(manifest);           
                    });           
                } else {           
                    Microloader.load(manifest);           
                }           
            },           
           
           
           
修改2:           
           
           
                  loadResources = function(resources, addLoadedFn){           
                        for (len = resources.length, i = 0; i < len; i++) {           
                            resource = resources[i];           
                            include = true;           
                            if (resource.platform && !Boot.filterPlatform(resource.platform)) {           
                                include = false;           
                            }           
                            if (include) {           
           
    //console.log('Resource路径:', Boot.baseUrl+resource.path);        
                                    urls.push(Boot.baseUrl + resource.path);       
    //urls.push(resource.path);       
           
                            }           
                        }           
           
           
           
           
           
步骤3: 拷贝CSS文件           
           
将ext-theme-neptune的样式文件放到你的项目 如HRM项目ci3\HRM\build\production\HRM\resources 目录下面,并把前缀都改成你的项目名称HRM-all.css  

 

 

         
打开HRM-all.css文件,修改成下面的内容           
@import 'HRM-all_01.css';@import 'HRM-all_02.css';           
           
  
           
步骤4:           
修改HRM/app.js 文件添加appFolder目录           
Ext.application({           
    name: 'HRM',           
    appFolder : 'HRM/app',           
    extend: 'HRM.Application',           
           
    autoCreateViewport: 'HRM.view.main.Main'           
           
    //-------------------------------------------------------------------------           
    // Most customizations should be made to HRM.Application. If you need to           
    // customize this file, doing so below this section reduces the likelihood           
    // of merge conflicts when upgrading to new versions of Sencha Cmd.           
    //-------------------------------------------------------------------------           
});           
           
步骤5:           
修改HRM/app/Application.js 文件添加appFolder目录           
           
Ext.define('HRM.Application', {           
    extend: 'Ext.app.Application',           
    appFolder : 'HRM/app',               
    name: 'HRM',           
           
    stores: [           
        // TODO: add global / shared stores here           
    ],           
               
    launch: function () {           
        // TODO - Launch the application           
    }           
});           
           
           
           
步骤6:           
做完上面操作后就能在CodeIgniter的View目录下面修改index.php 模板文件,就可以在将前台的extjs5的项目独立放在自己定义的项目HRM目录下面            
           
           
"<!DOCTYPE HTML>
<html manifest="""">
<head>
    <meta http-equiv=""X-UA-Compatible"" content=""IE=edge"">
    <meta charset=""UTF-8"">
    <title>HrManager</title>
 <script id=""microloader"" type=""text/javascript"" src=""<?php echo $this->config->base_url(); ?>/HRM/bootstrap.js""></script>

</head>
<body>

</body>
</html>"           

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值