Class lmbCmsApplication

Description

lmbFilterChain is an implementation of InterceptinfFilter design pattern.

lmbFilterChain contains registered filters and controls execution of the chain. Usually used as a FrontController in Limb based web applications (see web_app package)

lmbFilterChain can be an intercepting filter in its turn as well.

The best way to think about filters is as of a "russian nested doll", e.g:

  1.   // +-Filter A
  2.   // | +-Filter B
  3.   // | | +-Filter C
  4.   // | | |_
  5.   // | |_
  6.   // |_
To achieve this sample structure you should write the following code:
  1.   $chain new lmbFilterChain();
  2.   $chain->registerFilter(new A());
  3.   $chain->registerFilter(new B());
  4.   $chain->registerFilter(new C());

Remember, it's the filter that decides whether to pass control to the underlying filter, this is done by calling filter chain instance next() method.

Usage example:

  1.   lmb_require('limb/filter_chain/src/lmbFilterChain.class.php');
  2.   //create new chain
  3.   $chain new lmbFilterChain();
  4.   //register filter object in the chain
  5.   $chain->registerFilter(new MyFilter());
  6.   //register a handle for a filter in the chain
  7.   //in this case we can avoid PHP code parsing if
  8.   //this filter won't be processed
  9.   $chain->registerFilter(new lmbHandle('/path/to/MyFilter'));
  10.   //executes the chain
  11.   $chain->process();

  • version: $Id: lmbFilterChain.class.php 6243 2007-08-29 11:53:10Z pachanga $

Located in /cms/src/lmbCmsApplication.class.php (line 5)

lmbFilterChain
   |
   --lmbCmsApplication
Method Summary
 lmbCmsApplication __construct ()
Variables
Methods

Documentation generated on Wed, 07 Jan 2009 03:47:47 +0300 by phpDocumentor 1.3.2