SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
Building Lithium Apps (Like a Boss) was a workshop presented on the structure and philosophy of the Lithium framework and its applications, and how best to take advantage of them.
Building Lithium Apps (Like a Boss) was a workshop presented on the structure and philosophy of the Lithium framework and its applications, and how best to take advantage of them.
27.
There are no routes here yet
lithiumactionDispatcher {
//...
public static function run($request, ...) {
// Pass the request to the Router
$params = $classes['router']::process($request);
// Do some checking...
// Get a controller...
return static::call($controller);
}
}
28.
config/bootstrap/action.php
Dispatcher::applyFilter('run', function($self, $params, $chain) {
foreach (Libraries::get() as $name => $config) {
// Some sanity checking goes here...
include "{$config['path']}/config/routes.php";
}
return $chain->next($self, $params, $chain);
});
29.
lithiumactionDispatcher {
//...
public static function run($request, ...) {
// Pass the request to the Router
$params = $classes['router']::process($request);
// Do some checking...
// Get a controller...
// $controller = ...
return static::call($controller);
}
}
Dispatcher::applyFilter('run', function($self, $params, $chain) {
foreach (Libraries::get() as $name => $config) {
// Some sanity checking goes here...
include "{$config['path']}/config/routes.php";
}
return $chain->next($self, $params, $chain);
});
52.
my_awesome_plugin/
config/
bootstrap.php Required
routes.php Optional
anything_in_an_app/
Happens in the filter
we saw in action.php
Unless you
Libraries::add('my_awesome_plugin', array(
'bootstrap' => false disable it
));