Jennifer is a simple PHP framework that implements MVC pattern.
composer require ngodinhloc/jennifer
use Jennifer\Http\Response; use Jennifer\Http\Router; use Jennifer\Sys\System; try { $system = new System([DOC_ROOT . "/config/env.ini"]); $system->setRouter(new Router([DOC_ROOT . "/config/routes.ini"]))->loadView()->renderView(); } catch (Exception $exception) { (new Response())->error($exception->getMessage(), $exception->getCode()); }
use Jennifer\Api\Api; use Jennifer\Http\Response; use Jennifer\Sys\System; use thedaysoflife\Api\ServiceMapper; try { $system = new System([DOC_ROOT . "/config/env.ini"]); $system->setApi(new Api(new ServiceMapper()))->runAPI(); } catch (Exception $exception) { (new Response())->error($exception->getMessage(), $exception->getCode()); }
use Jennifer\Http\Response; use Jennifer\Http\Router; use Jennifer\Sys\System; try { $system = new System([DOC_ROOT . "/config/env.ini"]); $system->setRouter(new Router([DOC_ROOT . "/config/routes.ini"]))->loadController()->runController(); } catch (Exception $exception) { (new Response())->error($exception->getMessage(), $exception->getCode()); }
For example of implementation and usage, please take a look at Thedaysoflife project https://github.com/ngodinhloc/thedaysoflife.com which was developed using Jennifer framework