PHP Classes

File: fwphp/glomodul/z_examples/MVC_FW/02L2adlian_mvc_2009/index.php

Recommend this page to a friend!
  Classes of Slavko Srakocic   B12 PHP FW   fwphp/glomodul/z_examples/MVC_FW/02L2adlian_mvc_2009/index.php   Download  
File: fwphp/glomodul/z_examples/MVC_FW/02L2adlian_mvc_2009/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/02L2adlian_mvc_2009/index.php
Date: 1 year ago
Size: 1,605 bytes


Class file image Download
// index.php file
//namespaced class names
namespace B12phpfw ;

__DIR__ .'/autoload.php' ;

$controller = new Home_ctr();

/* function loader($class) //not namespaced class names
                     { $filename = $class . '.php';
                       $file ='classes/' . $filename;
                       if (!file_exists($file)) { return false; }
                       include $file ;
                     spl_autoload_register('loader'); */

// delegate all requests to c t r :

scripts : 2009 year

Possibilities of MVC pattern are endless. For example different layers can be implemented in different languages or distributed on different machines.
AJAX applications can implement V layer directly in Javascript in the browser, invoking JSON services. The controller can be partially implemented on client, partially on server?

    advantages of Model View Controller pattern:

    the Model and View are separated, making the application more flexible.
    the Model and view can be changed separately, or replaced. For example a web application can be transformed in a smart client application just by writing a new View module, or an application can use web services in the backend instead of a database, just replacing the model module.
    each module can be tested and debugged separately.