PHP Classes

File: fwphp/glomodul/z_examples/MVC_FW/01inanz/index.php

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/z_examples/MVC_FW/01inanz/index.php   Download  
File: fwphp/glomodul/z_examples/MVC_FW/01inanz/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change: Update of fwphp/glomodul/z_examples/MVC_FW/01inanz/index.php
Date: 1 year ago
Size: 707 bytes
 

Contents

Class file image Download
<?php
// J:\awww\www\fwphp\z_not_ongithub\MVC_FW\01inanz\index.php
// http://www.inanzzz.com/index.php/post/07gt/creating-a-simple-php-mvc-or-framework-application-from-scratch
require_once __DIR__.'/app/config.php';
require_once
CORE_PATH . 'autoload.php';
 
use
Core\Request;
 
$request = new Request($_SERVER, $_POST, $_GET, $_FILES);
 
try {
   
$controller = $request->getController();
   
$method = $request->getMethod($controller);
 
   
$controller = new $controller;
    echo
$controller->$method();

} catch (
Exception $e) {
    echo
sprintf(
       
'<h3>%s</h3><h4>%s</h4><h5>%s:%s</h5>',
       
$e->getCode(),
       
$e->getMessage(),
       
$e->getFile(),
       
$e->getLine()
    );
}