Deprecated/0.10/TheBasics

Warning! This page has the following tags:

  • This page is deprecated, and is only useful for developers using Agavi 0.10.
  • This page exists for reference purposes only.

The Basics

What's going on??

In the most basic terms, skipping over lots of gory details, this is the basics of how the framework operates

0.10.0 Flow

  • A Context is retrieved, which self initializes itself if it hadnt already been initialized (it's a singleton)
  • A controller is retrieved from the context
  • The Controller's dispatch method is called
    • determines a module/action to use
    • Forwards to module/action
  • Context's initialize method is called
    • loads configured objects for this particular context
    • returns a reference to itself
  • Controller's forward is called
  • Execute Filter (standard, it's configurable through the Context so a custom ExecutionFilter? may be used)
    • loads and executes validators
    • Executes the action
    • determines view to use
    • executes view's render method to render the output

0.9.0 Flow

(We strongly advise everyone to upgrade pre-0.10 Agavi installations to 0.10)

  • A Controller's dispatch method is called
    • Calls Controller's initialize method
    • determines a module/action to use
    • Forwards to module/action
  • Controller's initialize method is called
    • Passes a reference of itself to a request for an instance of Context [Context::getInstance($this)]
    • Requests references to various factory objects from the context
  • Context's getInstance is called
    • saves reference to calling controller (only a controller should ask the context for an instance directly)
    • loads configured factory objects (db, user, storage, etc)
    • returns singleton instance of self
  • Controller's forward is called
  • Execute Filter
    • loads and executes validators
    • Executes the action
    • determines view to use
    • executes view's render method to render the output