1. Introduction
    1. About Agavi
    2. MVC in Agavi
    3. Overview of Agavi
    4. Overview of Application Execution Flow
    5. A Word About Actions
    6. Application filesystem layout
    7. Overview of application configuration
  2. Setting Up The Initial Application
    1. Installing Agavi
    2. Creating an Agavi Project
    3. Finishing The Setup
    4. Finishing The Basic Setup
    5. Installing a New Copy of Your Application
  3. Adding First Code
    1. Creating A New module
    2. Creating A New Action
    3. Tying Things Together — An Introduction To Routing
    4. Fixing The Bloggie Routing
    5. Accessing Request Parameters and Validation Basics
    6. Handling Validation Errors
  4. Putting The M in MVC
    1. Creating A New Model
    2. Adapting The Actions and Views
    3. Custom Validators
  5. Polishing It Up
    1. Layers and Layouts
    2. Applying Our Layout
    3. What Are Slots?
    4. Adding The Post's Title To The URL
    5. Routing Callbacks
    6. Using Callbacks for the Title in URLs
  6. Connecting to a database
    1. The Database Manager
  7. Handling Output Variants
    1. Output Types
    2. Exception Templates
    3. Generating an RSS Feed
  8. Form Processing
    1. Adding a Post
    2. Editing a Post
    3. The Form Population Filter (FPF)
  9. Creating a User Authentication System
  10. Adding To The Master Template

Exception Templates

Exception templates are rendered when an unhandled exception occurs during the request processing. Exception templates can be configured in app/config/settings.xml and overwritten in app/config/output_types.xml. The configuration in settings.xml aims at setting up a reasonable default and is used if no configuration can be loaded from output_types.xml. This can happen in a variety of cases:


  • The error occurs before the configuration from output_types.xml is loaded, i.e. during the framework bootstrap.
  • There is no specific configuration for the active output type in output_type.xml

Configuration in settings.xml

The configration in settings.xml uses a special <exception_templates> block. Each entry can contain a context name and must specify a valid path to an exception template. The entry with an empty name is used as default for all contexts.

<exception_templates>
  <exception_template>%core.agavi_dir%/exception/templates/shiny.php</exception_template>
  <exception_template context="console">%core.agavi_dir%/exception/templates/plaintext.php</exception_template>
</exception_templates>
CAUTION:
While the shiny exception template provides a beautiful stacktrace and is very useful for debugging we strictly recommend against using it in production. Design your own error template an log the error instead of displaying it to the user.

Configuration in output_types.xml

The <output_type> tag can have an optional exception_template attribute, it contains the path to the template to use for this specific output type. The value supersedes any value from settings.xml.