Reputation: 1522
I am beginner in cakePHP and woking on cakePHP 2.0. I am trying to generate CSV file, to accomplish this task i am using the following method.
i have got stucked in step no. 2 when it is loading the plugin. the following error is occurring in app/Config/bootstrap.php file
Fatal error: Class 'CakePlugin' not found in /var/www/html/sitefolder/app/config/bootstrap.php on line 51
CakePlugin::load('Export');
Please correct me. Thnaks
Upvotes: 2
Views: 3726
Reputation: 1522
Thnaks guys for your precious response on this
For now i have find the solution of this by following steps.
download the plugin files form https://github.com/joshuapaling/CakePHP-Export-CSV-Plugin
by pass the step no.2 and step no.3 of what they have mentioned in official refer.
site_folder/app/controllers/components
add it in controller's component array variable
$components = array('blabla1', 'blabal2', 'Export')
create $data array variable (which contains the csv file data ) and just do like
$this->Export->exportCsv($data, 'filename1.csv');
Its done and working fine for me
Upvotes: 2