class Application extends Application

The Tsugi variant of a Lumen Application

Returns an augmented Lumen Application

<?php
require_once "../config.php";
$launch = \Tsugi\Core\LTIX::requireData();
$app = new \Tsugi\Lumen\Application($launch);
$app->get('/', 'AppBundle\\Attend::get')->bind('main');
$app->post('/', 'AppBundle\\Attend::post');
$app->run();

Methods

__construct($launch, $basePath = __DIR__)

Requires a Tsugi Launch object for initializing.

mixed
resolveExceptionHandler()

Override the Exception Handler

void
registerLogBindings()

Override the log bindings to use the php error log

tsugiReroute($route)

tsugiReroute - Send the browser to a new location with session

tsugiRedirectHome()

No description

tsugiRedirect($route)

No description

tsugiFlashSuccess($message)

tsugiFlashSuccess - Add a success message to the old and new flash session.

tsugiFlashError($message)

tsugiFlashError - Add an error message to the old and new flash session.

Details

at line 44
__construct($launch, $basePath = __DIR__)

Requires a Tsugi Launch object for initializing.

$launch = \Tsugi\Core\LTIX::requireData(); $app = new \Tsugi\Lumen\Application($launch);

The launch object is added to the $app variable and can be accessed as follows:

$app['tsugi']->user->displayname;

This sets up a PHP bridge session to allow old session and new session code to coexist.

Parameters

$launch
$basePath

at line 90
protected mixed resolveExceptionHandler()

Override the Exception Handler

I wrote a stack overflow question and after I wrote it I figured out the answer and wrote this method

https://stackoverflow.com/questions/65777054/how-do-i-add-a-custom-404-page-to-a-lumen-not-laravel-application

Return Value

mixed

at line 102
protected void registerLogBindings()

Override the log bindings to use the php error log

Return Value

void

at line 128
tsugiReroute($route)

tsugiReroute - Send the browser to a new location with session

Usage: $app->get('/', 'AppBundle\Attend::get')->bind('main'); $app->post('/', 'AppBundle\Attend::post');

Then at the end of the POST code, do this:

return $app->tsugiReroute('main');

Parameters

$route

at line 133
tsugiRedirectHome()

at line 140
tsugiRedirect($route)

Parameters

$route

at line 145
tsugiFlashSuccess($message)

tsugiFlashSuccess - Add a success message to the old and new flash session.

Parameters

$message

at line 154
tsugiFlashError($message)

tsugiFlashError - Add an error message to the old and new flash session.

Parameters

$message