vFrame is a PHP MVC Framework built to make your life as a developer a lot fun and stress free. vFrame also provides a RESTful API that allows you to easily write your API in an efficient and stressful way. Trust me! This is one of the coolest RESTful API I've ever worked with! :) vFrame is suitable for small and medium sized enterprise applications.
What vFrame provides
Getting Started
About MVC Frameworks
Creating Controllers
Example
Collaborate
A RESTful API.
Code re-use.
Modularity.
Layouts to allow for easy and dynamic web interface.
Database abstraction.
Lots of helpful classes and methods.
Constants to various paths in your project.
Great error handler.
Class autoloader.
Right-out-of-the-box assets and resources.
.htaccess to prevent unauthorized access to private files.
Awesome programming experience.
Easy bug trace.
Namespacing for code organisation.
Lightweight development.
among many others...
git clone https://github.com/victor-iyiola/vFrame.git or download zip into your web server directory (e.g. htdocs).cd path/to/project.config.ini file located at vFrame/app/libs/config.ini.project_path as appropriate and the database configurations.localhost/vFrame/ (depending on your server set up, you might need to change that as appropriate).vFrame is an MVC Framework, meaning the views are seprated from your models and they both go through the controller to pass information back and forth. MVC (or Model View Controller) is one of the design patterns created by the Gang of four.
vFrame/app/controllers.Controller e.g HomeController, AboutController, FrequentlyAskedQuestionController.Controller located @ vFrame/app/core/Controller.php.AppLibsController, you must override the abstract method index().Create a new PHP Class and name it HomeController.php
<?php
/**
* @author
* Created by victor.
* A.I. engineer & Software developer
* [email protected]
* On 06 09, 2017 @ 3:45 PM
* Copyright victor © 2017. All rights reserved.
*/
namespace AppControllers;
use AppCoreController;
class HomeController extends Controller
{
/**
* HomeController constructor.
*/
public function __construct()
{
parent::__construct();
$this->view->title = "Home"; // the title of the page
$this->view->css = ["home"]; // loads a custom css file (home.css)
}
/**
* Controller responsible for "/" or home page
*
* @credits Victor I. Afolabi <[email protected]>
* @endpoint localhost/vFrame/
*/
public function index()
{
// renders the home view located @ vFrame/app/views/home/index.php
$this->view->render('home/index');
}
/**
* Controller responsible for "/about"
*
* @credits Victor I. Afolabi <[email protected]>
* @endpoint localhost/vFrame/about
*/
public function about()
{
// renders the about view located @ vFrame/app/views/home/about.php
$this->view->render('home/about');
}
/**
* Controller responsible for "/contact"
*
* @credits Victor I. Afolabi <[email protected]>
* @endpoint localhost/vFrame/contact
*/
public function contact()
{
// renders the contact view located @ vFrame/app/views/home/contact.php
$this->view->render('home/contact');
}
}For more examples you can check the example branch.
Do not hesitate to send a pull request, I am open to all suggestions and collaborations. You can also shoot me a mail by clicking here