Debugging in Slim Framework PRO

The Slim framework allows us to enable a debugging mode. Once doing it, each time an exception is thrown the Slim framework will generate a detailed debugging message. The following code sample shows how to do it.

<?php

namespace Com\LifeMichael\Samples;

require 'Slim/Slim.php';

\Slim\Slim::registerAutoloader();

$application = new \Slim\Slim(array('debug' => false));

$application->get(
    '/dbg',
    function ()
    {
        $temp = 1/0;
        echo "<data>response sum=$sum</data>";
    });

$application->run();

?>

The following video clip overviews this code sample, shows its execution and provides a detailed explanation for each and every part of it.

You can find more video clips, code samples and training material for learning the Slim framework in my online free courses website at http://abelski.lifemichael.com.

Share:

The Visitor Design Pattern

The Visitor Design Pattern

The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences