Skip to content

GunioRobot/cakephp-csvio

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

CsvIoBehavior for CakePHP

Optimized for Windows baker.
Enabled editing CSV on Microsoft Office Excel.

Usage

  • copy into CakePHP application dir
  • edit this behavior file if you want to customize csv dirs
    • default: [import] config/csv/ | [export] tmp/csv/
  • change the permission of export directory to writable
  • attach behavior on model

Methods

  • importCsv
    • when given 1st arg false, truncate table before importing
  • exportCsv

Sample Controller

Usage

  • add following line on your bootstrap.php
Configure::write('Routing.prefixes', array('admin'));
  • access path ‘admin/csv/’

Actions

  • import
    • import data given 1st param tablename
  • import_all
    • import all data from existing csv files (default: config/csv/)
  • export_all
    • export all data to csv files (default: tmp/csv/)

About

Behavior for CakePHP supports CSV import/export.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%