2017 © Pedro Peláez
 

library jaxon-codeigniter

Jaxon library integration for the CodeIgniter framework

image

jaxon-php/jaxon-codeigniter

Jaxon library integration for the CodeIgniter framework

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

The README.md

Jaxon integration for CodeIgniter 4

This package integrates the Jaxon library into the CodeIgniter 4 framework., (*1)

Installation

The version 4 of the package requires CodeIgniter version 4., (*2)

Install the package with Composer., (*3)

composer require jaxon-php/jaxon-codeigniter ^4.0

Or, (*4)

{
    "require": {
        "jaxon-php/jaxon-codeigniter": "^4.0",
    }
}

And run composer install., (*5)

Filter

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

In the app/Config/Routes.php file, a route must be defined for Jaxon requests., (*7)

// Add the Jaxon filter to Jaxon-enabled routes.
$routes->get('/', 'Demo::index', ['filter' => JaxonConfigFilter::class]);

// Jaxon request processing route.
$routes->post('/jaxon', 'Demo::jaxon', ['filter' => JaxonConfigFilter::class]);

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

namespace App\Controllers;

use Jaxon\Demo\Ajax\Bts;
use Jaxon\Demo\Ajax\Pgw;

use function view;

class Demo extends BaseController
{
    public function index()
    {
        $jaxon = jaxon()->app();

        // Print the page
        return view('demo/index', [
            'jaxonCss' => $jaxon->css(),
            'jaxonJs' => $jaxon->js(),
            'jaxonScript' => $jaxon->script(),
            'pageTitle' => "CodeIgniter Framework",
            // Jaxon request to the Bts Jaxon class
            'bts' => $jaxon->request(Bts::class),
            // Jaxon request to the Pgw Jaxon class
            'pgw' => $jaxon->request(Pgw::class),
        ]);
    }

    public function jaxon()
    {
        $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();
    }
}

Configuration

Copy the config/Jaxon.php file in this package to the app/Config dir of the CodeIgniter app., (*9)

The settings in the config/Jaxon.php config file are 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 CodeIgniter application., (*10)

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

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., (*12)

Name Default value Description
directory 'jaxon/ajax' The directory of the Jaxon classes
namespace \Jaxon\Ajax 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 jaxon/app dir of the CodeIgniter application, and the associated namespace is \Jaxon\Ajax., (*13)

This is a simple example of a Jaxon class, defined in the jaxon/ajax/HelloWorld.php file., (*14)

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-codeigniter/issues
  • Source Code: github.com/jaxon-php/jaxon-codeigniter

License

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

The Versions

09/12 2017

dev-master

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

09/12 2017

v2.0.2

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

22/09 2017

v2.0.1

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

27/06 2017

v2.0.0

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

27/06 2017

dev-analysis-8w0rd4

dev-analysis-8w0rd4 https://github.com/jaxon-php/jaxon-codeigniter

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

29/05 2017

v2.0-beta.6

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

06/05 2017

v2.0-beta.5

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-3-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

01/05 2017

v2.0-beta.4

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

27/04 2017

v2.0-beta.3

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

19/03 2017

v2.0-beta.2

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

31/12 2016

v2.0-beta.1

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

17/11 2016

v1.0.x-dev

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

17/11 2016

v1.0.4

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

11/11 2016

v1.0.3

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

19/10 2016

v1.0.2

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

16/10 2016

v1.0.1

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon

15/07 2016

v1.0.0

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

Jaxon library integration for the CodeIgniter framework

  Sources   Download

BSD-2-Clause

The Requires

 

by Thierry Feuzeu

framework php ajax codeigniter xajax jaxon