jerni / amf-bundle
Symfony2 Bundle Amf 扩展
dev-master / 1.0.x-dev
2014-03-28 09:20 UTC
This package is not auto-updated.
Last update: 2024-09-28 15:24:30 UTC
README
使用 composer 安装 jerni/amf-bundle: php composer.phar require jerni/amf-bundle
branch: dev-master
在 AppKernel.php 中注册 Bundle
public function registerBundles()
{
new Jse\AmfBundle\JseAmfBundle(),
}
在 config/routing.yml 中添加
jse_amf_bundle:
resource: "@JseAmfBundle/Resources/config/routing.xml"
prefix: /gateway-service
在 config/config.yml 中添加
jse_amf:
service_path: Acme/DemoBundle
示例服务
//Acme/DemoBundle/Services/AmfService/TestService.php
use Jse\AmfBundle\Services\AmfServiceContainer;
class TestSevice extends AmfServiceContainer{
public function testsAction($obj){
$cat = $this->getContainer()->get('sonata.classification.manager.category')->findOneBy(array('id' => 1));
return json_encode($cat->getName());
}
}