Giter Club home page Giter Club logo

vframe's Introduction

vFrame

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.

Table of Contents

What vFrame provides

  • 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...

Getting Started

  • Clone this repository git clone https://github.com/victor-iyiola/vFrame.git or download zip into your web server directory (e.g. htdocs).
  • Change directory into your project folder cd path/to/project.
  • Open up the config.ini file located at vFrame/app/libs/config.ini.
  • Change the project_path as appropriate and the database configurations.
  • Open up your favorite web browser (hopefully Google Chrome) :) and enter the url localhost/vFrame/ (depending on your server set up, you might need to change that as appropriate).
  • Voila! Enjoy development.

About MVC Frameworks

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.

Creating Controllers

  • Create a new PHP Class in vFrame/app/controllers.
  • Naming convention is really important here.
  • It is important your start with UpperCase and every other word starts with an uppercase. All of your controllers must end with the word Controller e.g HomeController, AboutController, FrequentlyAskedQuestionController.
  • All controllers must extend the super class Controller located @ vFrame/app/core/Controller.php.
  • After extending the App\Libs\Controller, you must override the abstract method index().

Example

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 App\Controllers;

use App\Core\Controller;

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.

Collaborate

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

vframe's People

Contributors

victor-akin avatar victor-iyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vframe's Issues

The config.ini

Before lunching the frame work. Make sure you open the config.ini file located at vFrame/app/Libs/config.ini and change the default information as necessary.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.