PHP Classes

File: src/Controller/JaxonController.php

Recommend this page to a friend!
  Classes of Thierry Feuzeu   Jaxon for Symfony   src/Controller/JaxonController.php   Download  
File: src/Controller/JaxonController.php
Role: Class source
Content type: text/plain
Description: Class source
Class: Jaxon for Symfony
Jaxon integration for the Symfony framework
Author: By
Last change: Updated services definition.
Fixed method name.
Updated the plugin and the controller.
Updated the Jaxon controller
Adapted to the new class hierarchy is jaxon-core.
Date: 3 years ago
Size: 1,569 bytes
 

Contents

Class file image Download
<?php

namespace Jaxon\AjaxBundle\Controller;

use
Jaxon\AjaxBundle\Jaxon;

class
JaxonController
{
   
/**
     * @var Jaxon The Jaxon bundle
     */
   
protected $jaxon;

   
/**
     * The constructor.
     *
     * @param Jaxon $jaxon The Jaxon bundle
     */
   
public function __construct(Jaxon $jaxon)
    {
       
$this->jaxon = $jaxon;
    }

   
/**
     * Process a Jaxon request.
     *
     * The HTTP response is automatically sent back to the browser
     *
     * @return void
     */
   
public function index()
    {
       
// $this->jaxon->callback()->before(function ($target, &$bEndRequest) {
        // if($target->isFunction())
        // {
        // $function = $target->getFunctionName();
        // }
        // elseif($target->isClass())
        // {
        // $class = $target->getClassName();
        // $method = $target->getMethodName();
        // // $instance = $this->jaxon->instance($class);
        // }
        // });
        // $this->jaxon->callback()->after(function ($target, $bEndRequest) {
        // if($target->isFunction())
        // {
        // $function = $target->getFunctionName();
        // }
        // elseif($target->isClass())
        // {
        // $class = $target->getClassName();
        // $method = $target->getMethodName();
        // }
        // });

       
if($this->jaxon->canProcessRequest())
        {
            return
$this->jaxon->processRequest();
        }
    }
}