示例#1
0
<?php

// Initialize router
$router = new \Neuron\Router();
$broodModule = new Module();
// Make the module available on /account
$router->module('/', $broodModule);
return $router;
示例#2
0
<?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;
示例#4
0
<?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;
示例#5
0
<?php

// Initialize router
$router = new \Neuron\Router();
// Accounts module
$oauth2module = new \CatLab\OAuth2\Modules\OAuth2();
// Make the module available on /account
$router->module('/oauth2', $oauth2module);
$accounts = new \CatLab\Accounts\Module();
$accounts->addAuthenticator(new \CatLab\Accounts\Authenticators\Password());
$router->module('/account', $accounts);
// Catch the default route
$router->get('/', function () {
    return \Neuron\Net\Response::template('home.phpt');
});
return $router;