xielei/app

There is no license information available for the latest version (dev-master) of this package.

php tiny app

dev-master 2019-07-18 01:48 UTC

README

php tiny app

Installation

composer require xielei/app

Usage

event suggest
app.init init route,debug..
app.start auth..
app.end response.
app.404
app.405
$app = new \xielei\App();
$app->run('path');

# path
#    app
#       controller
#           Foo.php
#    event.php

# event.php
return [
	['app.init', function(){
		app()->route->add('*', '/', 'home/index');
	}],
	['app.start', function(){
		# todo
	}],
	['app.end', function($result){
		echo $result;
	}],
	['app.404', function($e){
		echo '404';
	}],
	['app.405', function($e){
		echo '405';
	}]
];

# http://host:port/foo/bar