foreverglory / routing-bundle
Symfony RoutingBundle
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- symfony/symfony: ~2.3|~3.0
This package is not auto-updated.
Last update: 2024-11-18 08:03:53 UTC
README
Use alias path to access the original Controller
使用别名路径访问原始Controller
###Usage
composer require foreverglory/routing-bundle
###AppKernel
class AppKernel extends Kernel { public function registerBundles() { $bundles[] = new Glory\Bundle\RoutingBundle\GloryRoutingBundle(); } }
###Configure
routing config routing.yml
homepage: path: /homepage defaults: { _controller: AppBundle:Default:index } newpage: path: /new defaults: { _alias: homepage }
###Code
//generate alias url $url = $container->get('router')->generate('homepage'); //$url: /new
{{path("homepage")}}