A predefined architecture to use the Phunder framework
A predefined architecture to use the Phunder framework.
Phunder is a lightweight MVC framework including a router and a templating engine.
PHP 7.1+ required
composer create-project aymdev/phunder-skeleton
After installing, you can reach the demo page :
Your PHP classes must be located in the
/src/ directory and follow the PSR-4 standard.
Config file should be located in the
/config/ directory and included at the end of
Every Front-End asset file must be located in
/public/ directory without mandatory structure (see URL management for linking).
Your controller classes must extend
For any data that you need into a template there is the
self::set('var_name', $obj->method()); self::set('key', 'value');
Phunder uses EKF - Element-Key-Flag as its core templating engine.
Create your templates in
/templates/ (change it by redefining
PHUNDER_TEMPLATE_DIRECTORY in a
To render a template, call your controller's
render method with the template path relative to the templates directory:
Take a minute to learn EKF syntax
Phunder uses PPRR - Pure PHP Regex Router as its core router.
Simply define routes as partial regular expressions (see above link) in
URL are rewritten by the
.htaccess file using mod_rewrite. Every request will be sent to
Your assets files (stylesheets, scripts, images ...) links must be prefixed with
<link rel="stylesheet" href="_front/css/styling.css">
There is a demo route to let you try it. You might be interested in looking at these files :
Phunder/ ├── src/ │ └── Controller/ │ └── Home.php ├── templates/ │ └── home.html └── public/ └── index.php