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.
- Host: GitHub
- URL: https://github.com/dacurse/p
- Owner: DaCurse
- Created: 2021-12-25T18:50:37.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-25T19:54:10.000Z (about 4 years ago)
- Last Synced: 2025-01-19T17:56:27.334Z (about 1 year ago)
- Topics: microframework, php, php-5, php-framework
- Language: PHP
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.