I have question about call to my module action via ajax.
I'd like call to class in my module via ajax. But best solution for me is call to clean class. Not extends Module.
I don't know hot can I make url without add article to database and add module to him.
I use JQuery instead mooTools but js framework is not important. Most important is call to php class by ajax.
I have ajax module. But if I call to ajax.php required is module id from tl_module table. I don't want use this table. (Ajax will be very often calling, I prefer to don't load all contao mechanism. It should be very fast).
Thanks in advance for answers.
I would suggest you to use Simple_Ajax extension. In this case you dont need to use Database and you can do pretty much anything you can do normally with Jquery ajax calls. It works with Contao 2.11 and you can call your php class with it. I find it much easier to use than ajax.php .
You can get it from : https://contao.org/de/extension-list/view/simple_ajax.de.html
Go to [CONTAO ROOT FOLDER]/system/modules and create a php file like following :
Create a folder called config with a php file like following ( You can hook you class to TL_HOOKS with class name - class method, simple_ajax will execute you method whenever a ajax call is made ):
Now you can easily make ajax calls with simply posting data to SimpleAjax.php: