Advertisement
Guest User

Slim Application Error

a guest
May 3rd, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2.  
  3. require_once '../vendor/autoload.php';
  4.  
  5. $container = new \Slim\Container;
  6.  
  7. $container['config'] = function ($c) {
  8.     return new \Noodlehaus\Config('../config/app.php');
  9. };
  10.  
  11. $container['view'] = function ($c) {
  12.     $view = new \Slim\Views\Twig('../resources/views');
  13.  
  14.     $view->addExtension(new \Slim\Views\TwigExtension(
  15.         $c['router'],
  16.         $c['config']->get('url')
  17.     ));
  18.  
  19.     return $view;
  20. };
  21.  
  22. $container['db'] = function($c) {
  23.     return new PDO('mysql:host=127.0.0.1;dbname=destructy', 'root', '');
  24. };
  25.  
  26. $container['mail'] = function ($c) {
  27.     return new \Mailgun\Mailgun($c['config']->get('services.mailgun.secret'));
  28. };
  29.  
  30. $app = new \Slim\App($container);
  31.  
  32. require_once 'routes.php';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement