Closed Rovak closed 11 years ago
Overall, this is a good one, but I don't really grasp the added feature (from my ExtJs ignorance). Is there some reference I could use to check what you are trying to achieve?
@Ocramius, I've modified the description to explain the purpose of this PR
@Rovak thank you, that clarifies a lot!
@Rovak just a quick tip before thinking of merging this stuff... Let's write docs before merging, gets easier to handle on the long run ;)
Will get my stuff done by tomorrow: still confused by namespaces...
Added examples in KJSenchaExample https://github.com/Rovak/KJSenchaExample/tree/feature/component-generator
If I get this correctly, you define (server side) components in a plugin manager, and then those get serialized into JS/JSON and served by a controller when the JS application requires them?
Exactly, it enables you to generate highly flexible components like grids, trees and forms (Maybe even convert Zend\Form to an ExtJS form) on the server side, or generate windows which depend on server-side logic like ACL.
An example can be found in KJSenchaExample right here
Right now the functionality is kinda limited, but it provides a good base to expand on and maybe even surpass current frameworks like http://php-ext.quimera-solutions.com/ and https://github.com/indowebit/Ext-PHP
KJSenchaExample Branch: https://github.com/Rovak/KJSenchaExample/tree/feature/component-generator
Component Generator Branch
This patch introduces a new feature where you can create Ext JS components on the PHP side, sometimes it's necessary to create complex windows which require a lot of server-side logic to create.
You can define server-side components in a ServiceManager like this:
And then on the client-side you can load the windows with the Ext.ComponentLoader like this:
or
In a later patch the components can be added to the bootstrap so you can extend the dynamically defined ExtJS classes in your MVC application.
Simple example, this should be configurable in the bootstrap options later