Lightweight Ajax Framework built in PHP with no foot-print. Allows you to build ajax functionality with a single line of code & do so much more, right from the back-end!
By default, CJAX plugin system requires you to create a js file with the function name to be the same as the plugin name(API name). For instance, there is a function upload() in upload plugin, and a function validate() in jquery validate plugin. This allows users to use ajax syntax such as $ajax->upload() and $ajax->validate().
However, there is a serious drawback with this approach, that it may suffer naming conflicts with third party libraries. This can result in the third party library's functions being overriden, and bugs that are hard to detect or debug.
As I am working on the plugin dragula right now, I find there is a dragula() function in the library for dragula. This wont be a problem for most jquery libraries though, but for libraries that use vanilla javascript, its highly possible to have such naming conflicts.
I am forced to rename the plugin to dracula then(otherwise defining a dragula() function will destroy the one from the third party library), to avoid naming conflicts. However, it may not be an ideal solution, as the API now becomes more confusing. I believe there's gotta be a better way to do this. Maybe, we can have a different naming convention for the js function? Maybe use prefix CJAX or suffix Plugin then? What do you think?
By default, CJAX plugin system requires you to create a js file with the function name to be the same as the plugin name(API name). For instance, there is a function upload() in upload plugin, and a function validate() in jquery validate plugin. This allows users to use ajax syntax such as $ajax->upload() and $ajax->validate().
However, there is a serious drawback with this approach, that it may suffer naming conflicts with third party libraries. This can result in the third party library's functions being overriden, and bugs that are hard to detect or debug.
As I am working on the plugin dragula right now, I find there is a dragula() function in the library for dragula. This wont be a problem for most jquery libraries though, but for libraries that use vanilla javascript, its highly possible to have such naming conflicts.
I am forced to rename the plugin to dracula then(otherwise defining a dragula() function will destroy the one from the third party library), to avoid naming conflicts. However, it may not be an ideal solution, as the API now becomes more confusing. I believe there's gotta be a better way to do this. Maybe, we can have a different naming convention for the js function? Maybe use prefix CJAX or suffix Plugin then? What do you think?