1、annotation
`编辑:app/config/routing.yml`
~~~
app:
resource: "@AppBundle/Controller/"
type: annotation
prefix: /
~~~
`编辑:src/AppBundle/Controller/TestController`
~~~
<?php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class AppController extends Controller {
/**
* @Route("/test", name="app_test")
* @return Response
*/
public function hightchartsAction()
{
return new Response();
}
}
~~~
2、yml
`编辑:app/config/routing.yml`
~~~
app:
resource: '@AppBundle/Resources/config/routing.yml'
prefix: /app
~~~
`编辑:src/AppBundle/Resources/config/routing.yml`
- 安装
- 配置
- web服务器
- DependencyInjection
- Serializer
- Ajax
- Annotation
- Controller
- Entity
- Components【组件】
- HttpFoundation【HTTP处理】
- Routing【路由处理】
- Form【表单处理】
- Validator【验证处理】
- ClassLoader【类加载】
- Templating【模板】
- Security【处理安全问题】
- Translation【语言翻译】
- Bundles【功能包】
- Doctrine
- entityManager
- entityRespository
- createQueryBuilder
- createNativeQuery
- find
- DoctrineBundle
- doctrine_config
- DoctrineFixturesBundle
- KnpMenuBundle
- KnpPaginatorBundle
- FOSUserBundle
- FOSRestBundle
- FOSCommentBundle
- FOSElasticaBundle
- SonataCoreBundle
- SonataBlockBundle
- SonataMediaBundle
- SonataAdminBundle
- DoctrineORMAdminBundle
- Sonata
- Install_Sonata
- Config_Sonata
- BlockService
- Custom_BlockService
- Custom_Admin
- Problems