Home arrow PHP arrow Page 4 - Mach-II for PHP: A Preview

Properties - PHP

Mach-II is a framework for organizing applications using standard OO techniques. This article will cover how to install, set up and configure a Mach-II application, and explore basic coding techniques.

TABLE OF CONTENTS:
  1. Mach-II for PHP: A Preview
  2. Installation
  3. Configuration
  4. Properties
  5. Event Handlers
  6. Basic Coding Techniques
  7. Creating Views
By: Mike Britton
Rating: starstarstarstarstar / 17
October 18, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Let’s examine <properties> first.

<!-- PROPERTIES -->
    <properties>
        <!-- MACH II REQUIRED -->
        <property name="defaultEvent" value="showMain" />
        <property name="exceptionEvent" value="exception" />
        <property name="applicationRoot" value="/phpMachII" />
        <property name="eventParameter" value="event" />
        <property name="parameterPrecedence" value="form" />
        <property name="maxEvents" value="10" /> 
    </properties>

Figure 4  mach-ii.xml <properties>

applicationRoot is an absolute or relative path responsible for directing the application to the display files in our app’s views directory. For our purposes it will be set to the current directory, “.”.

defaultEvent is the event you want called when the application first loads.

exceptionEvent is the event triggered for an unhandled exception. Built-in exception handling like this is good because it allows you to consider error handling from the very start. As you define events (we’ll get to that soon), you can build corresponding exception events seamlessly into your system.

eventParameter is the name of the Mach-II event we’ll be referencing in our code. Make it descriptive but easy to type.

parameterPrecedence is used to determine which request parameter to favor when there are simultaneous form and url ($_POST and $_GET) parameters. In our application we’ll want form as the default.

MaxEvents determines how many events are allowed per request.

For more on these Mach-II properties, see Mach-II Application Configuration.



 
 
>>> More PHP Articles          >>> More By Mike Britton
 

blog comments powered by Disqus
   

PHP ARTICLES

- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap

Dev Shed Tutorial Topics: