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.
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.
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.
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:
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.