Bundel Symfony untuk mengintegrasikan Sencha Ext JS ke dalam aplikasi Symfony
Anda dapat menginstal bundel ini menggunakan komposer
composer require teqneers/ext-application-bundle
Atau tambahkan paket ke file composer.json Anda secara langsung.
Setelah Anda menginstal paket, Anda hanya perlu menambahkan bundel ke file appkernel.php Anda:
// in AppKernel::registerBundles()
$ bundles = array (
// ...
new TQ Bundle ExtJSApplicationBundle TQExtJSApplicationBundle (),
// ...
);Ext-application-bundle memerlukan beberapa konfigurasi awal sehingga dapat menemukan file yang benar.
# Default configuration for extension with alias: "tq_ext_js_application"
tq_ext_js_application:
app_path: ~ # Required
builds: # Required
# Prototype
name:
development: # Required
build_path: ~ # Required
microloader: /bootstrap.js
manifest: /bootstrap.json
app_cache: null
production: # Required
build_path: ~ # Required
microloader: microloader.js
manifest: app.json
app_cache: cache.appcache
Karena bundel menyediakan pengontrolnya sendiri untuk melayani mikro-loader, manifes dan cache aplikasi manifes, Anda juga perlu mengonfigurasi perutean Anda untuk memasukkan rute bundel pada awalan yang diberikan. Edit app/config/routing.yml Anda:
# ...
ext_app:
resource: "@TQExtJSApplicationBundle/Resources/config/routing.yml"
prefix:/
# ...
Mengingat struktur direktori berikut dari aplikasi simfoni fiktif
./
|-- app/ Application configuration and assets
|-- src/ Application source code
|-- web/ Public web-facing directory (document root)
| |-- app.php Symfony production front controller
| |-- app_dev.php Symfony development front controller
| |-- app/ Root folder for Ext JS application production build
|-- ExampleApp/ The Ext JS application source folder
Konfigurasi Anda mungkin terlihat seperti ini
tq_ext_js_application:
app_path: '%kernel.project_dir%/ExampleApp'
builds:
default:
development:
build_path: build/development/ExampleApp
microloader: /bootstrap.js
manifest: /bootstrap.json
app_cache: ~
production:
build_path: build/production/ExampleApp
microloader: microloader.js
manifest: app.json
app_cache: cache.appcache
Menggunakan ekstensi ranting yang disediakan oleh bundel Anda dapat dengan mudah mengintegrasikan sumber daya aplikasi EXT JS ke dalam templat aplikasi Anda.
<!DOCTYPE HTML>
< html manifest = " {{ extjsAppCachePath() }} " lang = " en " >
< head >
< meta http-equiv = " X-UA-Compatible " content = " IE=edge " >
< meta charset = " UTF-8 " >
< meta http-equiv = " content-type " content = " text/html; charset=UTF-8 " />
< meta name = " viewport " content = " width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no " >
< title >Welcome!</ title >
< script type = " text/javascript " >
var Ext = Ext || {};
Ext . manifest = ' {{ extjsManifestPath()|e( ' js ' ) }} ' ;
</ script >
< script id = " microloader " data-app = " {{ extjsApplicationId() }} " type = " text/javascript " src = " {{ extjsBootstrapPath() }} " ></ script >
</ head >
< body >
</ body >
</ html >Lisensi MIT (MIT)
Hak Cipta (C) 2015 Teqneers Gmbh & Co. KG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Pemberitahuan hak cipta di atas dan pemberitahuan izin ini harus dimasukkan dalam semua salinan atau bagian substansial dari perangkat lunak.
Perangkat lunak ini disediakan "sebagaimana adanya", tanpa jaminan apa pun, tersurat maupun tersirat, termasuk tetapi tidak terbatas pada jaminan dapat diperjualbelikan, kebugaran untuk tujuan tertentu dan nonpringement. Dalam hal apa pun penulis atau pemegang hak cipta tidak akan bertanggung jawab atas klaim, kerusakan atau tanggung jawab lainnya, baik dalam tindakan kontrak, gugatan atau sebaliknya, timbul dari, di luar atau sehubungan dengan perangkat lunak atau penggunaan atau transaksi lain dalam perangkat lunak.