Fork me on GitHub

The Yii plugin


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

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

How it works

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

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

use Yii;
use yii\web\Controller;

class DemoController extends Controller
{
    public function actionIndex()
    {
        $jaxon = Yii::$app->getModule('jaxon');
        // Call the Jaxon module
        $jaxon->register();

        return $this->render('index', array(
            'JaxonCss' => $jaxon->css(),
            'JaxonJs' => $jaxon->js(),
            'JaxonScript' => $jaxon->script(),
        ));
    }
}