00001 <?php 00024 class WebRegisterController extends BaseController implements Controller { 00030 protected function __construct () { 00031 // Call parent constructor 00032 parent::__construct(__CLASS__); 00033 } 00034 00042 public final static function createWebRegisterController (CommandResolver $resolverInstance) { 00043 // Create the instance 00044 $controllerInstance = new WebRegisterController(); 00045 00046 // Set the command resolver 00047 $controllerInstance->setResolverInstance($resolverInstance); 00048 00049 00050 // Return the prepared instance 00051 return $controllerInstance; 00052 } 00053 00061 public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) { 00062 // Get the command instance from the resolver by sending a request instance to the resolver 00063 $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance); 00064 00065 // Add more filters by the command 00066 $commandInstance->addExtraFilters($this, $requestInstance); 00067 00068 // Run the pre filters 00069 $this->executePreFilters($requestInstance, $responseInstance); 00070 00071 // This request was valid! :-D 00072 $requestInstance->requestIsValid(); 00073 00074 // Execute the command 00075 $commandInstance->execute($requestInstance, $responseInstance); 00076 00077 // Run the pre filters 00078 $this->executePostFilters($requestInstance, $responseInstance); 00079 00080 // Flush the response out 00081 $responseInstance->flushBuffer(); 00082 } 00083 } 00084 00085 // [EOF] 00086 ?>
1.5.6