PHP Classes

File: src/dependencies.php

Recommend this page to a friend!
  Classes of uche   PHP Job Portal Project API   src/dependencies.php   Download  
File: src/dependencies.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Job Portal Project API
API to post working jobs and let freelancers apply
Author: By
Last change:
Date: 2 years ago
Size: 581 bytes
 

Contents

Class file image Download
<?php
// DIC configuration

$container = $app->getContainer();

// view renderer
$container['renderer'] = function ($c) {
   
$settings = $c->get('settings')['renderer'];
    return new
Slim\Views\PhpRenderer($settings['template_path']);
};

// monolog
$container['logger'] = function ($c) {
   
$settings = $c->get('settings')['logger'];
   
$logger = new Monolog\Logger($settings['name']);
   
$logger->pushProcessor(new Monolog\Processor\UidProcessor());
   
$logger->pushHandler(new Monolog\Handler\StreamHandler($settings['path'], $settings['level']));
    return
$logger;
};