Last active
March 21, 2018 23:30
-
-
Save tierra/2632372 to your computer and use it in GitHub Desktop.
Identical route configurations with CakePHP, Laravel, Ruby on Rails, Symfony, and Zend Framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Router::connect('/hello/world', array('controller' => 'hello', 'action' => 'world')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::get('hello/world', 'HelloController@getWorld'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ExampleApp::Application.routes.draw do | |
match '/hello/world' => 'Hello#world' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app: | |
path: /hello/world | |
defaults: { _controller: AppBundle:Hello:world } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'di' => array( | |
'instance' => array( | |
'Zend\Mvc\Router\RouteStack' => array( | |
'parameters' => array( | |
'routes' => array( | |
'module-hello-world' => array( | |
'type' => `Zend\Mvc\Router\Http\Literal`, | |
'options' => array( | |
'route' => '/hello/world', | |
'defaults' => array( | |
'controller' => 'Module\Controller\HelloController', | |
'action' => 'world', | |
), | |
), | |
), | |
), | |
), | |
), | |
), | |
// ... other di configuration ... | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@tierra the upcoming version 3.6 of CakePHP supports this as well:
See https://github.com/cakephp/cakephp/pull/11688/files