Skip to content

vitordm/VTRMVC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VTRMVC

  • A simple PHP MVC Framework
  • PHP >= 5.5

Updates

VTRMVC 1.0 is CLOSE! Why ? I'm working with VTRMVC 2.0. We publish our new version soon.

How to use ?

It's simple:

First, use composer...

...
"require" {
  "vtr/mvc" : "dev-master"
}
$ composer install

Define a JSON configuration file for your application. (Take a look on file "start_sample.json"). But be attention to principal nodes:

{
  ...
  "site_path" : ".",
  "tmp_path" : "./tmp",
  "log_path" : "./tmp/log",
  "mvc" : {
    "path" : "../app",
    ...
  }
  ...
}

Define a tree folder, where you will put your MVC Code, must be:

App Folder/
|
├── Controller/        # Controllers folder
|   ├── AppController.php
|   └── HomeController.php
├── Model/             # Models folder
|   ├── AppModel.php
|   └── HomeModel.php
└── View/              # Views folder
    └── Home/
        └── index.php   

After this, you can call the application:

<?php

include "../vendor/autoload.php"; // Composer file

try{

    $url = isset($_GET["_url"]) ? $_GET["_url"] : ""; // URL passing by .htaccess

    $app = new VTRMVC\Core\App();
    $app->start("../public/app.json", $url);


}catch (Exception $ex) {
    VTRMVC\Util\Util::varzx($ex->getMessage());
}

Do you need a sample ?

Please take a good look on "Sample" folder. You'll see how simple it is to do.

About

A simple PHP MVC Framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages