2017 © Pedro Peláez
 

symfony-bundle direct-bundle

Symfony 2 ExtDirect Bundle

image

modera/direct-bundle

Symfony 2 ExtDirect Bundle

  • Sunday, November 5, 2017
  • by modera
  • Repository
  • 5 Watchers
  • 1 Stars
  • 4,632 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 24 Versions
  • 0 % Grown

The README.md

ModeraDirectBundle

ModeraDirectBundle is an implementation of ExtDirect specification to Symfony framework., (*1)

Installation

Step 1: Download the Bundle

``` bash composer require modera/direct-bundle:4.x-dev, (*2)


This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation. ### Step 2: Enable the Bundle This bundle should be automatically enabled by [Flex](https://symfony.com/doc/current/setup/flex.html). In case you don't use Flex, you'll need to manually enable the bundle by adding the following line in the `config/bundles.php` file of your project: ``` php <?php // config/bundles.php return [ // ... Modera\DirectBundle\ModeraDirectBundle::class => ['all' => true], ];

Step 3: Add routing

``` yaml // config/routes.yaml, (*3)

direct: resource: "@ModeraDirectBundle/Resources/config/routing.yml", (*4)


## How to use ### Add the ExtDirect API into your page If you is using Twig engine, only add the follow line in your views page at the script section: ``` html <script type="text/javascript" src="{{ url('api') }}"></script>

Or if you are not using a template engine:, (*5)

``` html , (*6)


### Expose your controller methods to ExtDirect Api ``` php // .../Acme/DemoBundle/Controller/ExampleController.php namespace Acme\DemoBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Modera\DirectBundle\Annotation\Remote; use Modera\DirectBundle\Annotation\Form; class ExampleController extends AbstractController { /** * Single exposed method. * * @Remote // this annotation expose the method to API * * @param array $params * @return string */ public function indexAction(array $params) { return 'Hello ' . $params['name']; } /** * An action to handle forms. * * @Remote // this annotation expose the method to API * @Form // this annotation expose the method to API with formHandler option * * @param array $params Form submitted values * @param array $files Uploaded files like $_FILES */ public function testFormAction(array $params, array $files) { // your proccessing return true; } }

Call the exposed methods from JavaScript

js // 'AcmeDemo' is the Bundle name without 'Bundle' // 'Example' is the Controller name without 'Controller' // 'index' is the method name without 'Action' Actions.AcmeDemo_Example.index({ name: 'ExtDirect' }, function(r) { alert(r); });, (*7)

Licensing

This bundle is under the MIT license. See the complete license in the bundle: Resources/meta/LICENSE, (*8)

The Versions

05/11 2017

dev-sf3

dev-sf3 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

07/10 2017

dev-direct-bundle-csrf

dev-direct-bundle-csrf https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

24/09 2017

dev-master

9999999-dev https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

24/09 2017

v2.56.0

2.56.0.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

24/09 2017

dev-crub_pagination_fetch_fix

dev-crub_pagination_fetch_fix https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-963

dev-MPFE-963 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-975

dev-MPFE-975 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-977

dev-MPFE-977 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

v2.54.0

2.54.0.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-1005

dev-MPFE-1005 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-1007

dev-MPFE-1007 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-1014

dev-MPFE-1014 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-1017

dev-MPFE-1017 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

v2.55.0

2.55.0.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-1014-2

dev-MPFE-1014-2 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

02/01 2017

dev-MPFE-1029

dev-MPFE-1029 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

14/12 2016

2.x-dev

2.9999999.9999999.9999999-dev https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

05/09 2016

v2.52.0

2.52.0.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

05/09 2016

v2.52.1

2.52.1.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

05/09 2016

v2.52.2

2.52.2.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

05/09 2016

v2.53.0

2.53.0.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

22/07 2016

v2.0.50

2.0.50.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

22/07 2016

v2.51.0

2.51.0.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect

22/07 2016

v2.51.1

2.51.1.0 https://github.com/modera/direct-bundle

Symfony 2 ExtDirect Bundle

  Sources   Download

MIT

The Requires

 

extjs extdirect