I made a view helper in my CakePHP project, but I want to publish it for others to use.
In my own project, it's in the /app/View/Helper/ directory. However I'm uncertain where it should go when other people use it.
Should it be in
/Vendor/
/Vendor/View/Helper/
or something like that? In this case, will it automatically be loaded like it does with normal view helpers or do I need to call
App::import('Vendor', 'myhelperdir'.DS.'myhelper.php');
Should this call be made from the view itself, or from the controller?
Thanks!
Put it on github.com and package it into a plugin, add a composer.json file as well to the repository. That's the most easy way people can add the plugin to their project and maintain the plugin.
You can read this page how to create a plugin: http://book.cakephp.org/2.0/en/plugins.html#creating-your-own-plugins
How plugin helpers are loaded is explained as well on this page. Example:
public $helpers = ['PluginName.Helper'];