rogerclotet / angularjsbundle
Symfony2 集成 AngularJS 的包
1.0.4
2014-03-01 17:24 UTC
Requires
- php: >=5.3.2
- symfony/framework-bundle: >=2.0.0
This package is not auto-updated.
Last update: 2024-09-24 01:56:25 UTC
README
这个包为 AngularJS + Symfony2 项目提供了一个基础模板。它包含了 AngularJS 资产,并默认加载。
如果您需要一个更可扩展和可配置的选项,请查看这个其他项目: https://github.com/danidelalin/UndfAngularJsBundle
AngularJS
当前版本:1.2.0-rc3
包含的模块
- angular-loader
- angular-route
- angular-cookies
- angular-sanitize
- angular-resource
用法
要使用这个模板,您只需要以这种方式扩展它
{% extends 'TSAngularJSBundle::angular_base.html.twig' %}
要配置,只需在 AppKernel.php 中添加
$bundles = array( // ... new TS\AngularJSBundle\UdfAngularJSBundle(), )
编辑您的 composer.json 并在 "require" 对象中添加此行
{ "require": { "rogerclotet/angularjsbundle": "1.0.*" } }
并且您应该在您的 app/config/config.yml 中的 assetic 配置中添加此包
assetic: bundles: [ TSAngularJSBundle ]
默认情况下,AngularJS 应用和主控制器分别是 "myApp" 和 "MainCtrl"。您可以通过修改 "appname" 和 "maincontrollername" 块来更改它们的名称。