2017 © Pedro Peláez
 

library jaxon-yii

Jaxon library integration for the Yii Framework

image

jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  • Saturday, December 9, 2017
  • by lagdo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 33 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 17 Versions
  • 0 % Grown

The README.md

Jaxon integration for the Yii framework

This package integrates the Jaxon library into the Yii framework. It requires the version 2.0.11 or newer., (*1)

Installation

Add the following lines in the composer.json file, and run the composer update command., (*2)

"require": {
    "jaxon-php/jaxon-yii": "^4.0"
}

Or run the composer require jaxon-php/jaxon-yii command., (*3)

This package provides a filter that must be attached to routes to pages where the Jaxon features are enabled., (*4)

This is an example of a Yii controller using the Jaxon library., (*5)

namespace app\controllers;

use Yii;
use yii\web\Controller;
use Jaxon\Yii\Filter\JaxonConfigFilter;

class DemoController extends Controller
{
    public function behaviors()
    {
        return [
            [
                'class' => JaxonConfigFilter::class,
                'only' => ['index', 'jaxon'],
            ],
        ];
    }

    /**
     * Process Jaxon ajax requests. This route must be the same that is set in the Jaxon config.
     */
    public function actionJaxon()
    {
        $jaxon = jaxon()->app();
        if(!$jaxon->canProcessRequest())
        {
            // Jaxon failed to find a plugin to process the request
            return; // Todo: return an error message
        }

        return $jaxon->processRequest();
    }

    /**
     * Insert Jaxon js and css codes in the page.
     */
    public function actionIndex()
    {
        // Set the layout
        $this->layout = 'demo';
        // Get the Jaxon module
        $jaxon = jaxon()->app();

        return $this->render('index', [
            'jaxonCss' => $jaxon->css(),
            'jaxonJs' => $jaxon->js(),
            'jaxonScript' => $jaxon->script()
        ]);
    }
}

Before it prints the page, the controller calls the $jaxon->css(), $jaxon->js() and $jaxon->script() functions, to get the CSS and javascript codes generated by Jaxon which are inserted into the page., (*6)

Configuration

The Jaxon library settings are defined in the @app/config/jaxon.php file, and separated into two sections. The options in the lib section are those of the Jaxon core library, while the options in the app sections are those of the Jaxon application., (*7)

The following options can be defined in the app section of the config file., (*8)

Name Description
directories An array of directory containing Jaxon application classes
views An array of directory containing Jaxon application views
|

By default, the views array is empty. Views are rendered from the framework default location. There's a single entry in the directories array with the following values., (*9)

Name Default value Description
directory @app/jaxon/classes The directory of the Jaxon classes
namespace \Jaxon\App The namespace of the Jaxon classes
separator . The separator in Jaxon class names
protected empty array Prevent Jaxon from exporting some methods

Usage

The Jaxon classes

The Jaxon classes can inherit from \Jaxon\App\CallableClass. By default, they are located in the @app/jaxon/ajax dir of the Yii application, and the associated namespace is \Jaxon\Ajax., (*10)

This is an example of a Jaxon class, defined in the @app/jaxon/ajax/HelloWorld.php file., (*11)

namespace Jaxon\Ajax;

class HelloWorld extends \Jaxon\App\CallableClass
{
    public function sayHello()
    {
        $this->response->assign('div2', 'innerHTML', 'Hello World!');
    }
}

Contribute

  • Issue Tracker: github.com/jaxon-php/jaxon-yii/issues
  • Source Code: github.com/jaxon-php/jaxon-yii

License

The package is licensed under the BSD license., (*12)

The Versions

09/12 2017

dev-master

9999999-dev https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

09/12 2017

v2.0.2

2.0.2.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

22/09 2017

v2.0.1

2.0.1.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

27/06 2017

v2.0.0

2.0.0.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

27/06 2017

dev-analysis-8AkdKG

dev-analysis-8AkdKG https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

29/05 2017

2.0-beta.6

2.0.0.0-beta6 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

06/05 2017

2.0-beta.5

2.0.0.0-beta5 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

01/05 2017

2.0-beta.4

2.0.0.0-beta4 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

24/04 2017

2.0-beta.3

2.0.0.0-beta3 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

19/03 2017

2.0-beta.2

2.0.0.0-beta2 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

31/12 2016

2.0-beta.1

2.0.0.0-beta1 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

17/11 2016

v1.0.x-dev

1.0.9999999.9999999-dev https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

17/11 2016

v1.0.4

1.0.4.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

11/11 2016

v1.0.3

1.0.3.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

19/10 2016

v1.0.2

1.0.2.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

16/10 2016

v1.0.1

1.0.1.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon

15/07 2016

v1.0.0

1.0.0.0 https://github.com/jaxon-php/jaxon-yii

Jaxon library integration for the Yii Framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax yii xajax jaxon