Wikimedia SlimApp
Common classes to help with creating an application using the Slim micro framework and Twig template engine.
Loading...
Searching...
No Matches
Wikimedia\Slimapp\AbstractApp Class Reference

Grants review application. More...

Public Member Functions

 __construct ( $deployDir, array $settings=[])
 
 run ()
 Main entry point for all requests.
 

Static Public Member Functions

static redirect (Slim $slim, $name, $to, $routeName=null)
 Add a redirect route to the app.
 
static template (Slim $slim, $name, $routeName=null)
 Add a static template route to the app.
 

Protected Member Functions

 configureSlim (Slim $slim)
 Apply settings to the Slim application.
 
 configureIoc (Set $container)
 Configure inversion of control/dependency injection container.
 
 configureView (View $view)
 Configure view behavior.
 
 configureRoutes (Slim $slim)
 Configure routes to be handled by application.
 
 configureHeaderMiddleware ()
 Configure the default HeaderMiddleware installed for all routes.
 

Protected Attributes

 $deployDir
 
 $slim
 

Detailed Description

Grants review application.

Author
Bryan Davis bd808.nosp@m.@wik.nosp@m.imedi.nosp@m.a.or.nosp@m.g

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Slimapp\AbstractApp::__construct ( $deployDir,
array $settings = [] )
Parameters
string$deployDirFull path to code deployment
array$settingsAssociative array of application settings

Member Function Documentation

◆ configureHeaderMiddleware()

Wikimedia\Slimapp\AbstractApp::configureHeaderMiddleware ( )
protected

Configure the default HeaderMiddleware installed for all routes.

Default configuration adds these headers:

  • "Vary: Cookie" to help upstream caches to the right thing
  • "X-Frame-Options: DENY"
  • A fairly strict 'self' only Content-Security-Policy to help protect against XSS attacks
  • "Content-Type: text/html; charset=UTF-8"
Returns
array

◆ configureIoc()

Wikimedia\Slimapp\AbstractApp::configureIoc ( Set $container)
abstractprotected

Configure inversion of control/dependency injection container.

Parameters
Set$containerIOC container

◆ configureRoutes()

Wikimedia\Slimapp\AbstractApp::configureRoutes ( Slim $slim)
abstractprotected

Configure routes to be handled by application.

Parameters
Slim$slimApplication

◆ configureSlim()

Wikimedia\Slimapp\AbstractApp::configureSlim ( Slim $slim)
abstractprotected

Apply settings to the Slim application.

Parameters
Slim$slimApplication

◆ configureView()

Wikimedia\Slimapp\AbstractApp::configureView ( View $view)
abstractprotected

Configure view behavior.

Parameters
View$viewDefault view

◆ redirect()

static Wikimedia\Slimapp\AbstractApp::redirect ( Slim $slim,
$name,
$to,
$routeName = null )
static

Add a redirect route to the app.

Parameters
Slim$slimApp
string$namePage name
string$toRedirect target route name
string$routeNameName for the route

◆ template()

static Wikimedia\Slimapp\AbstractApp::template ( Slim $slim,
$name,
$routeName = null )
static

Add a static template route to the app.

Parameters
Slim$slimApp
string$namePage name
string$routeNameName for the route

The documentation for this class was generated from the following file: