tpg/extjs-bundle
TPG ExtJS Bundle integrates the ExtJS JavaScript framework with Symfony applications. It handles asset and configuration setup, provides integration helpers, and lets you build feature-rich ExtJS interfaces backed by Symfony routing, controllers, and templates.
This bundle wires the Sencha ExtJS client framework into a Symfony 2 application: asset loading, a Twig bootstrap helper, and — the interesting part — an Ext Direct dispatcher that lets ExtJS call Symfony services over a single batched RPC endpoint.
Minimum steps:
composer require tpg/extjs-bundle
// app/AppKernel.php
$bundles = [ /* ... */ new Tpg\ExtjsBundle\TpgExtjsBundle() ];
# app/config/config.yml
tpg_extjs:
library_path: "%kernel.root_dir%/../web/extjs" # your Sencha SDK, not on Packagist
Import the bundle routing if you want Ext Direct (app/config/routing.yml → tpg_extjs: → @TpgExtjsBundle/Resources/config/routing.xml).
Where to look first: the repo README, then DependencyInjection/Configuration.php — that file is the real documentation for config keys. Then Resources/config/services.xml to see what services and tags you can hook into.
First use case: render a trivial ExtJS panel from a Twig template using the bundle's asset/init helper, confirm CSS/JS load. Then do the second use case, which is the reason to use this bundle at all: tag a service as a Direct provider, load the generated api.js in your app, and call one method from Ext.direct.Manager. If that round-trip works, the rest is just schema mapping.
Configuration.php/README for the exact tag), and the bundle generates client stubs. This is the dominant pattern: repositories become grid stores (load/sync), form handlers become submit methods, and the client never sees Symfony routing.{type, tid, action, method, result}. Reserve normal controllers for page shells that render the ExtJS app.proxy of type direct → grid/panel → Twig template that bootstraps the app. Keep the ExtJS app in web/js, keep the contract in Symfony.Ext.application without duplicating <script> tags.{success: false, errors: {field: msg}} shape ExtJS renders natively. This is worth a dedicated class — you'll reuse it on every form.^6/^7 Symfony. Do not attempt to compose it into a modern Symfony or Laravel app; treat the source as a reference implementation and port the Direct dispatcher contract if you need it.library_path at it. A wrong path is the #1 setup failure — usually silent, with a 404 for /ext-all.js that only shows in the browser network tab.{type: 'exception', tid, ...}; if the whole response 500s, every call in the batch aborts and debugging becomes opaque.success: false plus an errors map for sync failures. Returning a standard Symfony validation payload renders nothing in the grid and looks like a client bug.kernel.request listener that logs $request->getContent() for the Direct route. The batched payloads are unreadable in the profiler otherwise.cache:clear after changing library_path or you'll chase a phantom path bug.composer.json exactly, commit the Sencha SDK into your repo, and add a smoke test that POSTs a batched Direct call and asserts the reply shape. That single test catches most of the failure modes above.How can I help you explore Laravel packages today?