00001 <?php 00025 class WebDefaultController extends BaseController implements Controller { 00031 protected function __construct () { 00032 // Call parent constructor 00033 parent::__construct(__CLASS__); 00034 } 00035 00042 public final static function createWebDefaultController (CommandResolver $resolverInstance) { 00043 // Create the instance 00044 $controllerInstance = new WebDefaultController(); 00045 00046 // Set the command resolver 00047 $controllerInstance->setResolverInstance($resolverInstance); 00048 00049 // Return the prepared instance 00050 return $controllerInstance; 00051 } 00052 00060 public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { 00061 // Get the command instance 00062 $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance); 00063 00064 // This request was valid! :-D 00065 $requestInstance->requestIsValid(); 00066 00067 // Execute the command 00068 $commandInstance->execute($requestInstance, $responseInstance); 00069 00070 // Flush the response out 00071 $responseInstance->flushBuffer(); 00072 } 00073 } 00074 00075 // [EOF] 00076 ?>
1.5.6