Fork me on GitHub

The CakePHP plugin


This example shows the usage of the Jaxon plugin for the CakePHP framework.

The configuration file, the classes and the views are found here.

How it works

Install and configure the Jaxon plugin for CakePHP, as described in the plugin documentation.

In the application controller, insert the code generated by Jaxon in the page.

namespace App\Controller;

class DemoController extends AppController
{
    public function initialize()
    {
        parent::initialize();
        // Load the Jaxon component
        $this->loadComponent('Jaxon/Cake.Jaxon');
    }

    public function index()
    {
        // Call the Jaxon module
        $this->Jaxon->register();

        $this->set('jaxonCss', $this->Jaxon->css());
        $this->set('jaxonJs', $this->Jaxon->js());
        $this->set('jaxonScript', $this->Jaxon->script());
        $this->render('demo');
    }
}

Demo