https://github.com/longtimejones/toucanine
A very simple, yet flexible, PHP5 HMVC-alike micro framework.
https://github.com/longtimejones/toucanine
framework hmvc mvc php php5 router
Last synced: 3 days ago
JSON representation
A very simple, yet flexible, PHP5 HMVC-alike micro framework.
- Host: GitHub
- URL: https://github.com/longtimejones/toucanine
- Owner: longtimejones
- License: mit
- Created: 2014-05-27T09:59:23.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-11-29T01:32:22.000Z (over 5 years ago)
- Last Synced: 2026-01-02T07:22:06.332Z (3 months ago)
- Topics: framework, hmvc, mvc, php, php5, router
- Language: PHP
- Homepage:
- Size: 77.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
 ToucaNine
=========
A very simple, yet flexible, PHP5 HMVC-alike micro framework.
***Notice:** the source has been revised nearly 6 years after release of v1.1.1. The framework was and is intended as a mock-up for OOP learning. PHP has progressed and matured a lot since v5.4. Many of the techniques used in the framework are now obsoleted in PHP v7.4.*
### Components
ToucaNine framework comes packed with Nette HTTP Component, Illuminate Database, and HTML Purifier.
### Requirements
PHP v5.4.0
### Installation
```
composer create-project longtimejones/toucanine --prefer-dist
```
### Basic usage instructions
```PHP
require __DIR__ . '/path/to/src/ToucaNine/Bootstrapper.php';
$app->route('GET /', function () use ($app) {
echo 'Hello, world!';
});
$app->dispatch();
```
**Setup app controller routes**
```PHP
$app->route('GET /hello-world', array(
'Welcome', /* App controller */
'helloWorld', /* Controller method */
));
$app->route('GET /hello-user/([^/]+)', array(
'Welcome', /* App controller */
'helloUser', /* Controller method */
'$1', /* Argument passed to method */
));
```
**Configuration file**
Configuration for machines, Illuminate Database, and HTML Purifier.
```
app/Config.php
```
**Executing HTML Purifier app helper**
```PHP
$this->helper('Html')->purifier()->purify($value);
```
**Executing Illuminate Database app model**
```PHP
$this->model('User')->byUsername($user)->first()
```
**HMVC**
```PHP
$this->controller('NameOfYourAppController')->invoke('nameOfControllerMethod', array(
$argument1,
$argument2,
...
));
```
**RESTful**
```PHP
$app->route('POST /example/id/([^/]+)', function () use ($app) {
...
});
```