Created
June 28, 2013 00:05
-
-
Save phalcon/5881459 to your computer and use it in GitHub Desktop.
This file contains 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 | |
class IndexController | |
{ | |
public function indexAction() | |
{ | |
echo '<h2>Running ' . __METHOD__ . '</h2>'; | |
} | |
} | |
$di = new Phalcon\DI\FactoryDefault(); | |
$di['view'] = function() { | |
$view = new Phalcon\Mvc\View(); | |
return $view; | |
}; | |
$di['router'] = function() { | |
$router = new Phalcon\Mvc\Router(); | |
$router->setDefaultModule('frontend'); | |
return $router; | |
}; | |
$application = new Phalcon\Mvc\Application($di); | |
// Register the installed modules | |
$application->registerModules( | |
array( | |
'frontend' => function($di) { | |
echo '<h1>Initializing frontend</h1>'; | |
}, | |
'backend' => function($di) { | |
echo '<h1>Initializing backend</h1>'; | |
} | |
) | |
); | |
echo $application->handle()->getContent(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment