About Exedra

Exedra is a nestful route-oriented PHP Micro-framework, capable of letting you design the map and routes of your application hierarchically, while being flexible, functional and contextual at the sametime, without much interfering with how your application is supposed to work.

As a microframework, there aren't much services/components you can expect. It's an alternative to anyone who seeks much minimal design yet expandable, a container, route/resource oriented capable microframework.

URI oriented routing

Imagine about having list of APIs, most of them repetitively written in nearly similar patterns.


GET  /api/articles
GET  /api/articles/:article-id
GET  /api/articles/:article-id/author
GET  /api/articles/:article-id/comments
POST /api/articles/:article-id/comments/
GET  /api/articles/:article-id/comments/:comment-id

Imagine growing this list to 5-10 times larger and maintaining them all.

The idea is, how about maintaining them hierarchically. Imagine about every segment of URI path, as a node. A node you can expand, validate, authenticate, maintain, separating the concern route orientedly. See this example about writing these APIs hierarchically.

How about performance

The routing map isn't wholly constructed unless traversed. A route along with the group/subroutes beneath it will not be traversed, if the initial validation like route methods, path segments didn't match.

Route based middleware

Once called a before and after filter in web development, middleware is an encompassing layer within request/response lifecycles, on which you can operate, maintain and leverage. In exedra, the use of middleware has been localized unto request-runtime-reponse lifecycle, on which they are even highly applicable on routing level.


$app->map->middleware(\App\Middleware\All::class)

$app->map['web']->any('/web')->group(function($group)
{
	$group->middleware(\App\Middleware\Web::class);

	$group['admin']->any('/admin')->group(function($admin)
	{
		$admin->middleware(function($exe)
		{
			if(!$exe->session->has('user'))
				throw new \Exception('User is not logged in.');

			return $exe->next($exe);
		});
	});
});

Is it REST capable?

Most of the convenient interfaces are already http verb oriented, the rest is designing the response, authentication, application design which is all up to developers themselves. Most of the examples shown are usually resourceful as you can see.