Skip to content

Instantly share code, notes, and snippets.

@funkytaco
Last active May 26, 2016 21:56
Show Gist options
  • Save funkytaco/6e12ffd25ea28bd6b11802fb360b9779 to your computer and use it in GitHub Desktop.
Save funkytaco/6e12ffd25ea28bd6b11802fb360b9779 to your computer and use it in GitHub Desktop.
return [
//Routes.
/** HTTP Method - URI - Array[Controller, controller method to call] **/
['GET', '/', [$IndexCtrl, 'get']],
['GET', '/about', [$IndexCtrl, 'getAbout']],
['GET', '/contact', [$IndexCtrl, 'getContact']]
];
<?php declare(strict_types=1);
namespace ProjectX;
use ProjectX\Presentation\Controller\Resource;
use ProjectX\Presentation\Controller\Error;
use ProjectX\Presentation\Controller\Index;
/** @var \CodeCollab\Router\Router $router */
$router
->get('/js/{filename:.+}', [Resource::class, 'renderJavascript'])
->get('/css/{filename:.+}', [Resource::class, 'renderStylesheet'])
->get('/not-found', [Error::class, 'notFound'])
->get('/method-not-allowed', [Error::class, 'methodNotAllowed'])
->get('/', [Index::class, 'index']);
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment