-
Notifications
You must be signed in to change notification settings - Fork 0
Application
John Aldrich Bernardo edited this page Feb 14, 2018
·
5 revisions
Calf Application is just a wrapper for everything in Calf. The only difference is just it gives the Saddle (Dependency Container) to the route you have provided.
<?php
require_once('vendor/autoload.php');
// Create a new Saddle (Dependency Injector)
$container = new \Calf\Saddle();
// More examples for our Saddle
$container->products = [
'supplies' => ['Pen'],
'fruits' => ['Apple', 'Pineapple']
];
$container->getProducts = function(\Calf\Saddle $c) {
return $c->products;
};
// Let's instantiate our application
$app = new \Calf\App($container);The calf is open-sourced software licensed under the MIT license.