2017 © Pedro Peláez
 

library basicmvc

Basic MVC for Frameworks

image

hkulekci/basicmvc

Basic MVC for Frameworks

  • Tuesday, September 22, 2015
  • by hkulekci
  • Repository
  • 4 Watchers
  • 9 Stars
  • 83 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

basicmvc

Basic MVC for Slim Framework Usage, (*1)

An example directory structure is following. You can change your structure what you want. You will specify your directories in your configurations., (*2)

    app/
        public/
            controller/
                ...
            model/
                ...
            view/
                ...
    .htaccess
    index.php

index.php file content is following. Define your directory constants and firstly, initialize Slim after that initalize BasicMVC. Thats all., (*3)

<?php 
/************** Some Configurations ****************/
define("APP_DIR", __DIR__ . "/app/");
define("APP_THEME", "default");
define("APP_TEMPLATE", APP_DIR . "public/view/theme/".APP_THEME."/");
/********** End of Some Configurations *************/


require_once __DIR__ . '/../vendor/autoload.php';

use BasicMVC\BasicMVC;

$twigView = new \Slim\Views\Twig();

$app = new \Slim\Slim(
    array(
        'mode'              => 'development', // development, test, and production
        'debug'             => true,
        'view'              => $twigView,
        'templates.path'    => APP_TEMPLATE
        )
    );

$basicmvc = new BasicMVC($app, array(
    "controllers_path"   => APP_DIR . "public/controller/",
    "models_path"        => APP_DIR . "public/model/",
    "library_path"       => APP_DIR . "public/system/library/",
    "template_constants" => array(
        "APP_THEME"     => APP_THEME
    )
));

$app->map('/(:directory(/:controller(/:method(/:args+))))', 
            function (
                $directory = "home", 
                $controller = "home", 
                $method = "index", 
                $args = array()
            ) use($app, $basicmvc) {

    $route = array(
        "directory"       => $directory,
        "controller"      => $controller,
        "method"          => $method,
        );

    echo $basicmvc->run($route, $args);

})->via('GET', 'POST', 'PUT', 'DELETE');

$app->run();

The Versions

22/09 2015

dev-master

9999999-dev

Basic MVC for Frameworks

  Sources   Download

GPL-3.0

The Requires

 

22/09 2015

v0.1.6

0.1.6.0

Basic MVC for Frameworks

  Sources   Download

GPL-3.0

The Requires

 

17/09 2014

v0.1.5

0.1.5.0

Basic MVC for Frameworks

  Sources   Download

GPL-3.0

The Requires

 

26/07 2014

v0.1.4

0.1.4.0

Basic MVC for Frameworks

  Sources   Download

GPL-3.0

The Requires

 

01/08 2013

v0.1.2

0.1.2.0

Basic MVC for Frameworks

  Sources   Download

GPL-3.0

The Requires

 

01/08 2013

v0.1.1

0.1.1.0

Basic MVC for Frameworks

  Sources   Download

GPL-3.0

The Requires

 

28/07 2013

v0.1

0.1.0.0

Basic MVC for Frameworks

  Sources   Download

GPL-3.0

The Requires