Download the PHP package lucasromanojf/ext-direct without Composer
On this page you can find all versions of the php package lucasromanojf/ext-direct. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucasromanojf/ext-direct
More information about lucasromanojf/ext-direct
Files in lucasromanojf/ext-direct
Package ext-direct
Short Description Laravel ExtJS/Sencha direct provider
License
Informations about the package ext-direct
Info
This is ext-direct provider for laravel 4.x (works with extjs 5 as well)
The idea behind ext-direct is to allow javascript to call remote php methods as they were client side javascript methods. This is reducing dramatically the development time.
Heavily(almost 99%) based on http://www.sencha.com/forum/showthread.php?102357-Extremely-Easy-Ext.Direct-integration-with-PHP
The original class was touched just a little bit.
Installation
Add this line to the composer.json require list and run composer update
Add to app.php 'providers' array:
This package comes with a Facade but you dont have to include it in your app.php it is automatically included.
You MUST publish or create this config file:
You MUST edit the config.php file:
Most important part is the api_classes array, there you have to list all the classes(normally controllers) from your application that you want to make availabe to extjs to call directly.
Note that it doesnt have to be associative array, you can simply list the class name in a normal indexed array. However if you list them as associative array then you can call them from extjs using the array element key
instead of the actuall controller class name. This way you can hide your real application structure from the front end.
TAG Direct methods In order for a controller method to be made available to extjs/sencha to call directly two conditions must be met:
1. Method needs to be declared as **public**
2. Method needs to contain comment tag @direct
example:
add a route in your routes.php
Lastly add something like this in your index.html (after extjs library and before your application code!!!)
Now you should be able to call laravel controller methods from javascript directly