2017 © Pedro Peláez
 

fuel-package fuel-ext-direct

FuelPHP Sencha Ext JS direct provider

image

xenophy/fuel-ext-direct

FuelPHP Sencha Ext JS direct provider

  • Friday, February 19, 2016
  • by xenophy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

fuel-ext-direct

FuelPHP Sencha Ext JS direct provider, (*1)

Install

composer require xenophy/fuel-ext-direct

Add setting to config.php

You should add fuel-ext-direct to 'always_load' -> 'packages' like a following, (*2)

'packages'  => array(
    'orm',
    'auth',
    'fuel-ext-direct',
),

Copy to config

packages/extdirect/config/extdirect.php to your FuelPHP config directory., (*3)

How to use

You should make fuel/app/classes/direct directory, after that create like a following php classses., (*4)

<?php

class Direct_Foo {

    /**
     * bar
     *
     * @param $age
     * @param $sage
     *
     * @remotable
     * @formHandler
     */
    function bar($age, $sage) {

        return "result bar";
    }

}

Method Comments

When you would like to publish your class method, you should write method comment., (*5)

This package will provide to Sencha Ext JS only @remotable in method comment. So, when you would like to use method as "Form Handler", Please write @formHandler in your method comment., (*6)

API definitions

Firstly, maybe you should write "Direct Provider" in your Application.js., (*7)

requires: [
    'Ext.direct.*'
],

launch: function () {
    Ext.direct.Manager.addProvider(Ext.REMOTING_API);
},

Next, you should add following settings in in your app.json. "path" is your local develoment host url using FuelPHP., (*8)

    "js": [
        {
            "path": "http://[your local develomnent host]/direct/api",
            "remote": true
        },
        {
            "path": "app.js",
            "bundle": true
        }
    ],

Conclusion

Please show your Sencha Ext JS Project via Sencha Cmd(jetty)., (*9)

http://localhost:1841/

After that, please try following JavaScript code in Developer Console., (*10)

Foo.bar("age", "sage", function(result) {
  console.log(result);
});

Maybe you can see "result bar" message., (*11)

Enjoy yourself!, (*12)

The Versions

19/02 2016

0.0.6

0.0.6.0

FuelPHP Sencha Ext JS direct provider

  Sources   Download

MIT

by Kazuhiro Kotsutsumi

10/02 2016

dev-master

9999999-dev

FuelPHP Sencha Ext JS direct provider

  Sources   Download

MIT

by Kazuhiro Kotsutsumi

10/02 2016

0.0.5

0.0.5.0

FuelPHP Sencha Ext JS direct provider

  Sources   Download

MIT

by Kazuhiro Kotsutsumi

10/02 2016

0.0.4

0.0.4.0

FuelPHP Sencha Ext JS direct provider

  Sources   Download

MIT

by Kazuhiro Kotsutsumi

07/02 2016

0.0.3

0.0.3.0

FuelPHP Sencha Ext JS direct provider

  Sources   Download

MIT

by Kazuhiro Kotsutsumi

07/02 2016

0.0.2

0.0.2.0

FuelPHP Sencha Ext JS direct provider

  Sources   Download

MIT

by Kazuhiro Kotsutsumi

02/02 2016

0.0.1

0.0.1.0

FuelPHP Sencha Ext JS direct provider

  Sources   Download

MIT

by Kazuhiro Kotsutsumi