Download the PHP package richardhj/contao-simple-ajax without Composer
On this page you can find all versions of the php package richardhj/contao-simple-ajax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package contao-simple-ajax
SimpleAjax for Contao Open Source CMS
SimpleAjax provides an endpoint for Ajax endpoints.
While it has been very convenient for Contao 3, this extension is not required for Contao 4 anymore. You should only use this extension in case your extension needs to be compatible with Contao 3 and Contao 4. Find the upgrade instructions below.
Changelog
v1.1.0 introduces the SimpleAjax\Event\SimpleAjax
. You are able to register an event listener. If you're not using
composer, you might want to use v1.0 instead and use the legacy hooks.
v1.2.0 lets you set an Response
instance (from the symfony/http package). This was introduced to prepare a smooth
upgrade process to Contao 4.
v1.3.0 is the Contao 4 release with equal features. The extension will not include any features as Contao 3 is approaching EOL.
Usage
Per Event
At first: Listen on the event SimpleAjax\Event\SimpleAjax
using one method described here.
Either: Set a Response
(recommended)
Or: Handwritten response with termination (legacy)
Per Hook (legacy)
Upgrade to Contao 4
This extension has been very convenient for Contao 3. While upgrading to Contao 4, you are advised to use the routing features coming with Contao 4.
In case you want to build an AppBundle (that's most probably true if you are no extension developer): Create an AppBundle
Implement the RoutingPluginInterface
in your Contao Manager Plugin and load the routing.yml with the getRouteCollection()
.
Create a routing.yml
, e.g. in the directory src/AppBundle/Resources/config/routing.yml
Put the following content:
Create the AppBundle\Controller\AjaxTagsController.php
.
You can use https://github.com/richardhj/isotope-klarna-checkout/blob/v1.0/src/Controller/Push.php as a boilerplate.
The __invoke()
method contains all the parameters that are mentioned in the path of the routing definition (routing.yml
).
All versions of contao-simple-ajax with dependencies
contao/core-bundle Version ^4.4
symfony/http-foundation Version ^3.3 || ^4.1