Umstellung auf eigene Ajax-Verarbeitung über Route "rateit"
This commit is contained in:
34
src/Controller/AjaxRateItController.php
Normal file
34
src/Controller/AjaxRateItController.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: darko
|
||||
* Date: 23.10.17
|
||||
* Time: 23:55
|
||||
*/
|
||||
|
||||
namespace cgoIT\rateit\Controller;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use cgoIT\rateit\RateIt;
|
||||
|
||||
class AjaxRateItController extends Controller {
|
||||
/**
|
||||
* Handles rating requests.
|
||||
*
|
||||
* @return JsonResponse
|
||||
*
|
||||
* @Route("/rateit", name="ajax_rateit", defaults={"_scope" = "frontend", "_token_check" = false})
|
||||
*/
|
||||
public function ajaxAction() {
|
||||
|
||||
$this->container->get('contao.framework')->initialize();
|
||||
|
||||
$controller = new RateIt();
|
||||
|
||||
$response = $controller->doVote();
|
||||
$response->send();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user