fir
Initial release.
Fir. A lightweight PHP MVC Framework.
The Fir framework started as micro-framework with the purpose of being used in private projects, with the strongest points being extremly fast and easy to use. Fir is not a replacement for professional frameworks, however if you want to quickly build a prototipe app, make a couple of AJAXed pages and do a couple of database calls, Fir should be a good option.
Back-end
Front-end
| Software | Modules |
|---|---|
| PHP >=7 | mbstring |
| Apache >=2 | mod_rewrite |
| MySQL >=5 |
composer create-project pricop/fir /your-projectfir.sql file into your database.app/includes/config.php file, and update the values YOURDBUSER, YOURDBNAME, YOURDBPASS, https://localhost/your-project with your own information.You can now access your website using the URL you defined in APP_PATH.
/app/controllers folder.Controller class, e.g: class Auth extends Controller {}.public function index() {}.$this->model('Example') method.['content' => $this->view->render($data, 'auth/register')], where $data is an array object which contains the data that's passed to the views, while 'auth/register' would be the view's path.index method of the controller.$this->url property.$this->lang property.namespace FirControllers;
class Auth extends Controller
{
public function index()
{
return ['content' => $this->view->render($data, 'auth/index')];
}
public function register()
{
return ['content' => $this->view->render($data, 'auth/register')];
}
}/app/models folder.Model class, e.g: class Auth extends Model {}.$this->db property.namespace FirModels;
class Auth extends Model
{
public function get()
{
// SQL query here
}
}/public/theme/views folder.$data array object holds all the data that's passed from the Controllers.e function, e.g: e('Example').$_SESSION['message'] using the $this->message() method.$this->lang('key') method.$this->token() method.app/core/View.php.<?php
defined('FIR') OR exit();
?>
<?= e("Hello World") ?>While this documentation could be more extensive, the code is well commented and most of the things you need to know can be found straight into the examples provided within the framework.
Happy coding.