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

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- 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...

Developer Shed Affiliates

 



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

Dev Shed Tutorial Topics: