Download the PHP package grobmeier/cicada without Composer
On this page you can find all versions of the php package grobmeier/cicada. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download grobmeier/cicada
More information about grobmeier/cicada
Files in grobmeier/cicada
Package cicada
Short Description Tiny PHP framework for quickly creating webapps, inspired by Rubys Sinatra
License Apache-2.0
Homepage https://github.com/cicada/cicada
Informations about the package cicada
Cicada
A micro framework for creating traditional or REST-like web applications.
Installation
Add Cicada as a requirement for your project via Composer:
Usage
Minimal application:
This application has one route which will match GET requests starting with
/hello/
and will forward the matched {name}
into the callback function as
$name
.
The callback function should return a Response object. If it returns a string, it will implicitly be converted into a Response.
Handling exceptions
It is possible that route callbacks throw an exception. By default, Cicada will in this case return a HTTP 500 response (Internal Server Error). However, it is possible to add exception handlers which will intercept specific exceptions and return an appropriate response.
For example, if you want to catch a custom NotImplementedException and return a custom error message:
The callback function passed to $app->exception()
must have a single argument
and that argument must have a class type hint which denotes the exception class
which it will handle.
It's possible to specify multiple exception handlers and they will be tried in order in which they were specified:
All versions of cicada with dependencies
evenement/evenement Version ~2.0.0
symfony/http-kernel Version ~2.6.0
symfony/http-foundation Version ~2.6.0
pimple/pimple Version ~3.0.0