ais / haribundle
充满Hari的包
dev-master / 0.0.1.x-dev
2016-01-11 02:53 UTC
Requires
- php: >=5.3.9
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ^2.4.8
- friendsofsymfony/rest-bundle: @dev
- incenteev/composer-parameter-handler: ~2.0
- ircmaxell/password-compat: ~1.0
- jms/serializer-bundle: @dev
- leafo/scssphp: ~0.1.5
- nelmio/api-doc-bundle: @dev
- patchwork/jsqueeze: ~1.0
- sensio/distribution-bundle: ~4.0
- sensio/framework-extra-bundle: ^3.0.2
- symfony/assetic-bundle: ~2.3
- symfony/monolog-bundle: ~2.4
- symfony/swiftmailer-bundle: ~2.3
- symfony/symfony: 2.7.*
- willdurand/rest-extra-bundle: @dev
Requires (Dev)
- doctrine/doctrine-fixtures-bundle: dev-master
- guzzle/plugin: 3.7.*
- liip/functional-test-bundle: dev-master
- phpunit/phpunit: 3.7.*
- sensio/generator-bundle: ~2.3
- symfony/phpunit-bridge: ~2.7
This package is not auto-updated.
Last update: 2024-09-24 18:27:10 UTC
README
为AIS创建的hari Bundle。我在我的工具包中使用了Symfony 2.7.4。如果你想要安装Symfony,请访问以下链接
使用方法
我假设你已经在你的开发环境中安装了composer。如果没有,请访问此链接
在你的根目录的composer.json文件的require标签内添加以下内容
{ "require": { "ais/haribundle" : "dev-master" }, }
运行composer update,并等待更新完成。
php composer.phar update
在AppKernel.php中注册该bundle
一旦composer update完成。如果你之前尚未安装NelmioApiDocBundle,你也需要注册它。
因为这个bundle需要NelmioApiDocBundle来查看API文档。我还使用了JMS Serializer和FOSRestBundle。
<?php // app/AppKernel.php use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\Config\Loader\LoaderInterface; class AppKernel extends Kernel { public function registerBundles() { $bundles = array( ... new Nelmio\ApiDocBundle\NelmioApiDocBundle(), new FOS\RestBundle\FOSRestBundle(), new JMS\SerializerBundle\JMSSerializerBundle(), new Ais\HariBundle\AisHariBundle(), ); ... return $bundles; } }
将路由导入到你的app/config/routing.yml中
ais_haris: type: rest prefix: /api resource: "@AisHariBundle/Resources/config/routes.yml" NelmioApiDocBundle: resource: "@NelmioApiDocBundle/Resources/config/routing.yml" prefix: /api/doc
看看里面有什么
现在你通过访问你的url dev可以看到可用的API
ex: https:///web/app_dev.php/api/doc
发现一个错误?请通过PR向我提出。如果你发现一些错误,请通过电子邮件帮助我修复它 vizzlearn@gmail.com