duanqiao0153 2014-07-19 06:30
浏览 286

如何使用importcsv插件读取CSV文件数据

i want to read data from CSV file ( which is stored in my web directory ) using YII y , after searching i came across importcsv extension.

i have tried setting modules and path , but now i don't know how to use this importcsv extension , i didn't get any example over net too , just to read data from CSV and then store it in mysql database.

here is my config.php

 'importcsv'=>array(
            'path'=>'assets/importCsv/', // path to folder for saving csv file and file with import params
        ),
  • 写回答

1条回答 默认 最新

  • duangai2831 2014-07-19 16:41
    关注
    1. in your yii application -> in protected folder you need to create modules folder;
    2. create importcsv folder in modules folder;
    3. extract the github extension code ("yii-importcsv-extension-master->importcsv") in importcsv root folder (is important to have the same name of the folder with the name of the module set in config). You need to have one folder named importcsv in modules folder containing all the code ("views folder, controller folder, models folder...etc.");
    4. in config->main.php you need to set in modules

      'importcsv'=>array( 'path'=>'assets/importCsv/', // path to folder for saving csv file and file with import params ),

    Very important !!! The module need to be extracted in protected/modules folder not in protected/extensions folder and the name writhed in config/main.php -> modules need to be exactly the same on the folder extracted in modules.

    1. Access the module with the same name writhed in config:

      http://www.host.com/yourproject/importcsv.

      Or here:

      http://www.host.com/yourproject/index.php?r=importcsv.

    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记