Download the PHP package activecollab/controller without Composer
On this page you can find all versions of the php package activecollab/controller. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download activecollab/controller
More information about activecollab/controller
Files in activecollab/controller
Package controller
Short Description Invokable controller that accepts containers, works with ETag and more
License MIT
Informations about the package controller
Controller
Supported action responses:
\ActiveCollab\Controller\Response\FileDownloadResponse
- streams a file download.\ActiveCollab\Controller\Response\StatusResponse
- returns a HTTP status, without response body.\ActiveCollab\Controller\Response\ViewResponse
- Renders a particular view.
When within a controller action, use these methods to get individual request parameters:
getParsedBodyParam()
getCookieParam()
getQueryParam()
getServerParam()
All of these methods accept three parameters:
$request
(\Psr\Http\Message\ServerRequestInterface
instance)$param_name
(string)$default
(mixed,NULL
by default)
Configuration
Controllers can override protected configure()
method to do additional setup after controller construction. This method is separated from constructor, so developer does not need to inherit and manage complicated controller constructor.
Exception Handling
When action fails due to an exception, system will return 500 HTTP error, with a message that does not expose any of the system details.
This is done in such a way that new RuntimeException
is constructed, with generic error message, and real exception is passed as $previous
constructor argument of the new exception. If you have your system configured so exceptions are fully described when 500 errors are rendered (in debug mode for example), you'll be able to access original exception detials like that.
To change default exception message, call setLogExceptionMessage()
controller method:
If $logger
is added to the controller (during construction or later on), all exceptions that actions throw will be logged with error level.
To do
- Add
$payload
to status shortcut methods.
All versions of controller with dependencies
ext-json Version *
activecollab/containeraccess Version ^2.0
activecollab/etag Version ^1.0
activecollab/templateengine Version ^3.0
activecollab/utils Version ^2.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.0
psr/http-server-middleware Version ^1.0
psr/log Version ~1.0
laminas/laminas-diactoros Version ^2.8