xenophy/fuel-ext-direct 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

xenophy/fuel-ext-direct

Composer 安装命令:

composer require xenophy/fuel-ext-direct

包简介

FuelPHP Sencha Ext JS direct provider

README 文档

README

FuelPHP Sencha Ext JS direct provider

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

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

Copy to config

packages/extdirect/config/extdirect.php to your FuelPHP config directory.

How to use

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

<?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.

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.

API definitions

Firstly, maybe you should write "Direct Provider" in your Application.js.

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.

    "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).

http://localhost:1841/

After that, please try following JavaScript code in Developer Console.

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

Maybe you can see "result bar" message.

Enjoy yourself!

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-02-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固