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
 

Contents

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

require_once
__DIR__ .'/autoload.php' ;

$controller = new Home_ctr();
$controller->invoke();


                 
/* 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 :
//include_once("Home_ctr.php");

/*
see http://php-html.net/tutorials/model-view-controller-in-php/
scripts : 2009 year http://sourceforge.net/projects/mvc-php/
  http://sourceforge.net/projects/mvc-php/files/mvc.zip/download

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.
*/
?>