2017 © Pedro Peláez
 

yii2-extension yii2-extjs-rest

REST API for Sencha ExtJS 5+

image

tvip/yii2-extjs-rest

REST API for Sencha ExtJS 5+

  • Friday, June 24, 2016
  • by Stanyslav
  • Repository
  • 6 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Yii 2 REST API for ExtJs(sencha)

REST API ActiveController support for input parameters extjs and serialize response. Enable in extjs store remoteSort, remoteFilter and autoSync in viewModel., (*1)

EXAMPLE PROXY CLASS EXTJS

Ext.define('tvip.proxy.YiiRestProxy', {
    extend: 'Ext.data.proxy.Rest',
    alias: 'proxy.yiirest',

    type: 'rest',

    reader: {
        type: 'json',
        rootProperty: 'data',
    },

    writer: {
        type: 'json'
    },

    headers: {
        "Accept": "application/json",
    },
});

INSTALLATION

composer require tvip/yii2-extjs-rest

USE

Example controller, (*2)

<?php
namespace app\modules\api\components;

use Yii;
use yii\helpers\ArrayHelper;
use tvip\ExtJsRest\ActiveController;

class Controller extends ActiveController
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return ArrayHelper::merge(parent::behaviors(),[
            'corsFilter' => [
                'class' => \yii\filters\Cors::className(),
                'cors' => [
                    'Origin' => ['*'],
                    'Access-Control-Request-Headers' => ['*'],
                    'Access-Control-Request-Method' => ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'],
                ],
            ]
        ]);
    }
}

The Versions

24/06 2016

dev-master

9999999-dev

REST API for Sencha ExtJS 5+

  Sources   Download

BSD-3-Clause

The Requires

 

api rest yii2 yii 2 extjs sencha extjs5 extjs6

24/06 2016

1.0.0

1.0.0.0

REST API for Sencha ExtJS 5+

  Sources   Download

BSD-3-Clause

The Requires

 

api rest yii2 yii 2 extjs sencha extjs5 extjs6