Wednesday, February 6, 2019

How to add a plugin to CakePHP 3

As my Unity game is data driven I'm using Cake 3 (which uses PHP) to create and edit data in a MySQL database. The database tables are then exported as CSV files and imported into Unity as resource files.

I had a bit of trouble getting the cakephp-csvview plugin to install so I used a combination of steps from the following to web pages.


The first link is the one that finally got things working.

1. From the console on your web server navigate to the directory where your cake project lives. Be sure to open the console as Administrator.

2. Install the plugin with the command:
composer require friendsofcake/cakephp-csvview
3. Load the plugin with the command:
bin\cake plugin load CsvView
4.  In the Cake project edit the file config/bootstrap.php and add the following line in the plugins section near the end of the file:
Plugin::load("CsvView");
 The plugin should now be installed and ready to use.