<?php // Initialize router $router = new \Neuron\Router(); $router->get('/', '\\Example\\Controllers\\HomeController@main'); $router->get('/templates', '\\Example\\Controllers\\HomeController@templates'); $router->get('/test/{something?}', function ($a) { return \Neuron\Net\Response::json($a); }); return $router;
<?php // Initialize router $router = new \Neuron\Router(); // Accounts module $signinmodule = new \CatLab\Accounts\Module(); $signinmodule->requireEmailValidation(); //$signinmodule->setLayout ('index-account.phpt'); $password = new \CatLab\Accounts\Authenticators\Password(); $signinmodule->addAuthenticator($password); $facebook = new \CatLab\Accounts\Authenticators\Facebook(); $signinmodule->addAuthenticator($facebook); $steam = new \CatLab\Accounts\Authenticators\Steam(); $signinmodule->addAuthenticator($steam); $mailer = new \CatLab\Mailer\Module(); $router->module('/mailer', $mailer); // Make the module available on /account $router->module('/account', $signinmodule); $router->get('/thirdparty', function () { $request = \Neuron\Application::getInstance()->getRouter()->getRequest(); $deligatedAccounts = $request->getUser()->getDeligatedAccounts(); return \Neuron\Net\Response::template('thirdparty.phpt', array('accounts' => $deligatedAccounts)); })->filter('authenticated'); // Catch the default route $router->get('/', function () { return \Neuron\Net\Response::template('home.phpt'); }); return $router;
<?php // Initialize router $router = new \Neuron\Router(); // Accounts module $signinmodule = new \CatLab\OpenIDClient\Module(); // Make the module available on /account $router->module('/account', $signinmodule); // Catch the default route $router->get('/', function () { return \Neuron\Net\Response::template('home.phpt'); }); return $router;