Sleek Action Edit | SourceForge - PHP - Freshmeat - Gibson Research - Ubuntu Linux - Clusty Search - Babel Fish Translation - WordReference Dictionaries - Wiktionary - ASP
php.MVC, The Model View Controller Framework for PHP Web Applications
  Free OpenSource Downloads
The Model View Controller Framework for PHP Web Applications
 
spacer Features •  Demos •  Docs •  Design •  Download •  CVS •  Support •  Developers

spacer
Getting Started with php.MVC

Contents:
  Introduction
  Application Developers
  Framework Developers

Introduction:

(Draft: 28.July.2003)

There is two basic approaches that can be taken when working with the php.MVC Web application framework. The first and easiest track is to gain a basic working knowledge of the library and how to build an application with the library. This will be relatively easy for experienced Web application developers.

The second and more difficult track is to gain a deeper understanding of the library design and methodology. This should only be necessary for people interested in developing the php.MVC library code or building PlugIn mechanisms etc.

Application Developers:

This section is aimed at those wanting to develop Web applications using php.MVC.

Experienced server-side developers should be able to get a working knowledge of php.MVC in a week or two. It will take a little longer for other developers who will usually need to gain a working knowledge of a DBMS (database management system) and other server-side techniques.

Getting Started:



  • Jakarta Struts Pocket Reference:
    Jakarta Struts Pocket Reference (O'Reilly)
    Free Sample Excerpt: Configuring Struts (PDF)

    Note that the relevant sections in the free chapter are from pages 10 to 26: The Struts Configuration Files.
    There is some slight variation in php.MVC from the Struts struts-config_1_1.dtd. The latest release php.MVC "/WEB-INF/phpmvc-config_1_1.dtd" is the ultimate reference to configuration options in php.MVC.

    Note that some features have not yet been setup in php.MVC: The global-exceptions Element, The global-forwards Element The message-resources Element.

    Note that the several configuration settings in the "Main.php" files in php.MVC applications will eventually be moved to xml configuration files.


  • Review the Kooka case study:
    Downloads index

    Note that the Kooka case study is a more complex example application. This example shows how to call different methods on one class, e.g. "do=addToCart" or "do=removeFromCart". And shows how to link to the application business code.

  • Review the php.MVC test cases:
    Some features of php.MVC can be found here that are not yet documented. For example MessageFormatTestCase shows how message string handling works.
    The php.MVC test cases are in the test directory: "\WEB-INF\classes\phpmvc\test\*.*".


The "Building an Application with php.MVC" pattern:

Most of the examples and guides follow a similar pattern when describing the process of setting up an application in php.MVC:

  • Setup the xml configuration/bindings for an application (phpmvc-config.xml).

    Note that the application configuration is recompiled and serialised to the "phpmvc-config.data" file each time a change is made to the phpmvc-config.xml file.

  • Build a FormBean (ActionForm subclass - handle form validation ...)

  • Build an Action class (Action subclass - link to business logic here)

  • Build an Action Dispatcher (ActionDispatcher subclass - loads the page resource)

  • Build the View resource (A simple HTML/PHP page, or a Smarty template page, ... )

  • Activate trace logging to get an overview of control flow in the application/framework:
    Set: $this->log->setLog('isTraceEnabled' , True); in the relevant classes.
    Some of the core library classes are shown below:
  • Trace Logging
    Class Method Location
    ActionServer Constructor "WEB-INF\classes\phpmvc\action\*.*"
    RequestProcessor Constructor "WEB-INF\classes\phpmvc\action\*.*"
    ActionDispatcher Constructor "WEB-INF\classes\phpmvc\utils\*.*"



Framework Developers:

For those wanting to develop and/or extend the php.MVC framework:

For most people this track will require considerable commitment of time and effort. Experience with Jakarta Struts would be a substantial advantage as the php.MVC design is modeled very closely on Struts. Much of the core design documentation available for Jakarta Struts will be of help and a good reference source for working with php.MVC.

Research:



Document version: Draft: 28.July.2003
Copyright © 2003 John C. Wildenauer. All rights reserved.

Printable Page
spacer

SleeK Action Edit - Code Editor for Windows PHP Logo php.MVC Logo SourceForge
Copyright © 2006 John C. Wildenauer. All rights reserved.