Overview

Namespaces

  • Charcoal
    • App
      • Action
      • Config
      • Handler
      • Middleware
      • Module
      • Route
      • Script
      • ServiceProvider
      • Template

Classes

  • AbstractHandler
  • Error
  • HandlerConfig
  • NotAllowed
  • NotFound
  • PhpError
  • Shutdown

Interfaces

  • HandlerInterface
  • Overview
  • Namespace
  • Class

Class AbstractHandler

Base Error Handler

Enhanced version Slim's error handlers.

It outputs messages in either JSON, XML or HTML based on the Accept header.

Charcoal\App\Handler\AbstractHandler implements Charcoal\Config\ConfigurableInterface, Charcoal\App\Handler\HandlerInterface, Psr\Log\LoggerAwareInterface, Charcoal\View\ViewableInterface uses Charcoal\Config\ConfigurableTrait (not available) Psr\Log\LoggerAwareTrait (not available) Charcoal\Translator\TranslatorAwareTrait (not available) Charcoal\View\ViewableTrait (not available)

Direct known subclasses

Charcoal\App\Handler\Error, Charcoal\App\Handler\NotAllowed, Charcoal\App\Handler\NotFound, Charcoal\App\Handler\PhpError, Charcoal\App\Handler\Shutdown
Abstract
Namespace: Charcoal\App\Handler
Located at Charcoal/App/Handler/AbstractHandler.php
Methods summary
public
# __construct( Pimple\Container $container )

Return a new AbstractHandler object.

Return a new AbstractHandler object.

Parameters

$container
A dependencies container instance.

Implementation of

Charcoal\App\Handler\HandlerInterface::__construct()
public Charcoal\App\Handler\AbstractHandler
# init( )

Initialize the AbstractHandler object.

Initialize the AbstractHandler object.

Returns

Charcoal\App\Handler\AbstractHandler
Chainable

Implementation of

Charcoal\App\Handler\HandlerInterface::init()
public Charcoal\App\Handler\AbstractHandler
# setDependencies( Pimple\Container $container )

Inject dependencies from a Pimple Container.

Inject dependencies from a Pimple Container.

Dependencies

  • AppConfig $appConfig — The application's configuration.
  • UriInterface $baseUri — A base URI.
  • ViewInterface $view — A view instance.

Parameters

$container
A dependencies container instance.

Returns

Charcoal\App\Handler\AbstractHandler
Chainable
public Charcoal\App\Handler\AbstractHandler
# setContainer( Pimple\Container $container )

Set container for use with the template controller

Set container for use with the template controller

Parameters

$container
A dependencies container instance.

Returns

Charcoal\App\Handler\AbstractHandler
Chainable
public ConfigInterface
# createConfig( mixed|null $data = null )

ConfigurableTrait > createConfig()

ConfigurableTrait > createConfig()

Parameters

$data
Optional config data.

Returns

ConfigInterface

See

ConfigurableTrait::createConfig()
protected string
# determineContentType( Psr\Http\Message\ServerRequestInterface $request )

Determine which content type we know about is wanted using "Accept" header

Determine which content type we know about is wanted using "Accept" header

Parameters

$request
The most recent Request object.

Returns

string
protected string
# renderHtmlOutput( )

Render HTML Error Page

Render HTML Error Page

Returns

string
public string
# messageTitle( )

Render title of error

Render title of error

Returns

string
abstract public string
# renderHtmlMessage( )

Render body of HTML error

Render body of HTML error

Returns

string
protected string
# renderHtmlTemplate( )

Render HTML Error Page

Render HTML Error Page

Returns

string
public Charcoal\App\Handler\AbstractHandler
# setBaseUrl( string|Psr\Http\Message\UriInterface $url )

Set the base URL (home page).

Set the base URL (home page).

Parameters

$url
A URL to the base URL.

Returns

Charcoal\App\Handler\AbstractHandler
Chainable
public string
# baseUrl( )

Retrieves the URL for the home page.

Retrieves the URL for the home page.

Returns

string
A URL representing the home page.
Properties summary
protected Pimple\Container $container

Container

Container

#
protected string $baseUrl

URL for the home page

URL for the home page

#
protected array $knownContentTypes

Known handled content types

Known handled content types

# [ 'application/json', 'application/xml', 'text/xml', 'text/html', ]
API documentation generated by ApiGen