longtimejones / toucanine
A very simple, yet flexible, PHP5 HMVC-alike micro framework.
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=5.4
- ezyang/htmlpurifier: ~4.9
- illuminate/database: ~4.2
- nette/http: ~2.4
Conflicts
- nette/utils: >=3.0
- symfony/polyfill-mbstring: >=1.2
- symfony/translation: >=4.0
This package is auto-updated.
Last update: 2022-08-25 07:05:55 UTC
README
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
require __DIR__ . '/path/to/src/ToucaNine/Bootstrapper.php'; $app->route('GET /', function () use ($app) { echo 'Hello, world!'; }); $app->dispatch();
Setup app controller routes
$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
$this->helper('Html')->purifier()->purify($value);
Executing Illuminate Database app model
$this->model('User')->byUsername($user)->first()
HMVC
$this->controller('NameOfYourAppController')->invoke('nameOfControllerMethod', array( $argument1, $argument2, ... ));
RESTful
$app->route('POST /example/id/([^/]+)', function () use ($app) { ... });