added CSV output for MYOB. Hope it works
This commit is contained in:
parent
7d4dfc8e23
commit
7d1acd18b4
|
|
@ -201,6 +201,11 @@ class CustomersController extends AppController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function csv() {
|
||||||
|
$this->set('customers', $this->Customer->find('all', array('recursive'=>0)));
|
||||||
|
$this->layout = 'csv';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
views/customers/csv.ctp
Normal file
6
views/customers/csv.ctp
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php //debug($customers); ?>
|
||||||
|
|
||||||
|
<?php foreach($customers as $cust) {
|
||||||
|
echo $cust['Customer']['name'].",".$cust['Customer']['abn']."\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
6
views/layouts/csv.ctp
Normal file
6
views/layouts/csv.ctp
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?
|
||||||
|
header("Content-type:application/csv");
|
||||||
|
|
||||||
|
|
||||||
|
echo $content_for_layout;
|
||||||
|
?>
|
||||||
Loading…
Reference in a new issue