static function log($message, $code, $file = '', $line = 0, $context = null) { $message = "[" . ($file ? "{$file}:{$line}" : "") . "#{$code}] " . str_replace(array("\r", "\n"), " ", strip_tags($message)); \mini::log($message); return $code; }
<?php // Mini PHP Framework -- a demo and exercise in framework programming // initialize the mini class - it will handle autoload, errors, templates, etc require_once 'Mini.php'; require_once 'Debug.php'; mini::init();
<?php // get the mini framework (defines the mini class in the main namespace) require_once "mini/index.php"; // get the controller object of this project (you can produce this however you want) $site = mini::make('site'); // handle the request via this controller (will call $site->respond($request)) mini::start($site);
function lg($message, $flags = 0) { return \mini::log($message, $flags); }
<?php /** * 控制器分配模板 */ include './mini.class.php'; $mini = new mini(); $title = '测试模板'; $content = '测试内容'; $mini->assign('title', $title); $mini->assign('content', $content); $mini->display('index.html');