josegonzalez/cakephp-csvview — pull request #31 by HowardBraham (2014-05-31 04:55:50+00:00)
Title: Added two new options for headers: $includeClassname and $humanReadable

I really like this CakePHP plugin, but I needed a more flexible option to export a CSV that was not intended to be read by humans, but intended to be parsed by another program.

To achieve that, I added two new options for the default headers output by CsvViewComponent.

New Options
---------------
* $includeClassname -- if true, the class name will be included in the default generated titles
* $humanReadable -- if true, underscores in variable names will be replaced by spaces, and the first character of each word will be uppercased

Results
---------
* If both options are set to true, column "user_id" from model "Post" will render as "Post User Id," just as it does now.
* If $includeClassname=true and $humanReadable=false, it will render as "Post user_id"
* If $includeClassname=false and $humanReadable=true, it will render as "User Id"
* If both are false, it will render as "user_id"

I originally made these modifications for my own use, but I figured that others might also find them useful. Therefore, I made both options true by default, which makes these changes backwards compatible -- existing programs will require no modifications.

If you approve this Pull Request, I will also update the documentation.

Thanks josegonzalez!