PHP Classes

File: src/dependencies.php

Recommend this page to a friend!
  Classes of Chun-Sheng, Li   PHP Women's Menstruation   src/dependencies.php   Download  
File: src/dependencies.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Women's Menstruation
Application to calculate women's menstruation days
Author: By
Last change:
Date: 1 year 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;
};