Download the PHP package mezon/ajax-application without Composer
On this page you can find all versions of the php package mezon/ajax-application. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mezon/ajax-application
More information about mezon/ajax-application
Files in mezon/ajax-application
Package ajax-application
Short Description Simple class for creating ajax applications
License MIT
Homepage https://github.com/alexdodonov/mezon-ajax-application
Informations about the package ajax-application
Ajax Application
Intro
Mezon Framework provides simple class for creating ajax applications. This class uses all functionality of the Mezon Application Class also provides usefull functionality:
- automatic creation of the routes '{RouteName}' from methods like 'action{RouteName}';
- routes setup from config.
- action messaging.
Installation
Just print in console
And that's all )
Learn more
More information can be found here:
It will be great if you will contribute something to this project. Documentation, sharing the project in your social media, bug fixing, refactoring, or even submitting issue with question or feature request. Thanks anyway ) I'll be very glad if you'll press "STAR" button )
Exception handling
For better debugging exception handling is performed in a special way. If the ajax request will be failed to process, then on the front end you will get JSON object with fields:
- code - code of the occured error;
- message - textual description of the occured error;
- call_stack - call stack for the call wich lead to the error.
Finishing request processing
After finishing request processing you can mark it as successfull:
Wich will return {"code": 0}
Or return any other result:
In this case $result will be encoded in JSON and outputted.
Or in case of the error you can call
Wich will return object {"code": $code, "message": "message"}