Topic: New Xajax package
I would like to share the work I've done on the Xajax library with the community.
I've been using this package for years now, and for me there is no such other package for building Ajax applications rapidly.
I'm currently using Xajax in a Laravel 5.1 application running on PHP7, so I needed to make some changes to make it work with PHP7, and to integrate to the Laravel framework.
The modified Xajax package is here: https://github.com/lagdo/xajax, and this is a summary of the changes I made.
- All the constructors are renamed from class name to __construct.
- The references are removed where they are not really needed.
- The XAJAX_PAGE_NUMBER parameter and the setPageNumber() method are added to the request object to ease the creation of pagination links.
- The ReflexionClass is used to get the name and methods of callable objects.
- A classpath can be defined for each registered callable object, allowing the creation o
This last feature is one of the most important, as it has allowed me to organise the PHP classes of my Xajax app into a multilevel subdirectory hierarchy. Unfortunately, for now this feature is available only in the Xajax package for the Laravel framework, which is found here: https://github.com/lagdo/lajax.
This package leverages the unique features of Laravel to automatically create and initialize the Xajax object, and load all the classes from a defined directory. Moreover, only the required class is loaded when processing a request, allowing to achieve best performances. Of course, the Xajax classes can be organised into multiple subdirectories, and they can even be namespaced. This way, it is much more easy to build bigger applications with Xajax.
As I was thinking about how to allow the use of classpaths and namespacing right in the Xajax library, I came to the conclusion that the library needs some recoding.
The goal is to take advantage of the advanced features of PHP like namespacing, autoloading, composer, to make the Xajax library simpler to install and use, modular and extensible.
I've started working on the new packages, which I'll introduce here in a few days.
So stay tuned!