An open API service indexing awesome lists of open source software.

https://github.com/dacurse/p

Yet another PHP Microframework.
https://github.com/dacurse/p

microframework php php-5 php-framework

Last synced: 7 months ago
JSON representation

Yet another PHP Microframework.

Awesome Lists containing this project

README

          

# ρ

Yet another PHP Microframework.

The premise of this framework is to be backwards-compatible (PHP <= 5.6) with powerful utilities (Like caching and
logging) and sensible defaults.

## Routes

Unlike other PHP frameworks, which have you define routes using classes and controllers, ρ has a more intuitive
approach, using files and directories to create routes:

```
routes
├─ $name.php
└─ index.php
```

Your route directory is your root (`/`), `index.php` would match requests to `/` or `/index`. Routes starting with a `$`
are parameterized routes, basically serving as a fallback route, with access to the path that was requested. You can
create nested parameterized routes (For multiple parameters) by separating parameters with a `.`:

```
routes
└─ $forumId.$postId.php
```

A request to `/foo/bar` will fall back to `$forumId.$postId.php` and you'll get access to both parameters as `forumId`
and `postId` respectfully.