code/Controller.php
protected function handleAction($request, $action)
	{
		$module = $this->findModule();
		
		if(!$module) {
			return parent::handleAction($request, $action);
		}
		
		$data = [];
		
		if($this->isGreenPage()) {
			$data = $this->data()->toViewableData();
		}
		elseif($module->getDataSource()) {
			$data = $module->getDataSource()->toDBObject();
		}

		$module->loadRequirements();
		$viewer = $this->getViewer($action);					
		$viewer->setTemplateFile('Layout', $module->getLayoutTemplateFile());

		$main = $module->getMainTemplateFile();
		if($main) {
			$viewer->setTemplateFile('main', $main);
		}
		
		return $viewer->process($this->customise($data));
	}
protected function handleAction($request, $action)
	{
		$module = $this->findModule();
		
		if(!$module) {
			return parent::handleAction($request, $action);
		}
		
		$data = [];
		
		if($this->isGreenPage()) {
			$data = $this->data()->toViewableData();
		}
		elseif($module->getDataSource()) {
			$data = $module->getDataSource()->toDBObject();
		}

		$module->loadRequirements();
		$viewer = $this->getViewer($action);					
		$viewer->setTemplateFile('Layout', $module->getLayoutTemplateFile());

		$main = $module->getMainTemplateFile();
		if($main) {
			$viewer->setTemplateFile('main', $main);
		}
		
		return $viewer->process($this->customise($data));
	}
protected function handleAction ( $ request , $ action ) { $ module = $ this -> findModule ( ) ; if ( ! $ module ) { return parent :: handleAction ( $ request , $ action ) ; } $ data = [ ] ; if ( $ this -> isGreenPage ( ) ) { $ data = $ this -> data ( ) -> toViewableData ( ) ; } elseif ( $ module -> getDataSource ( ) ) { $ data = $ module -> getDataSource ( ) -> toDBObject ( ) ; } $ module -> loadRequirements ( ) ; $ viewer = $ this -> getViewer ( $ action ) ; $ viewer -> setTemplateFile ( 'Layout' , $ module -> getLayoutTemplateFile ( ) ) ; $ main = $ module -> getMainTemplateFile ( ) ; if ( $ main ) { $ viewer -> setTemplateFile ( 'main' , $ main ) ; } return $ viewer -> process ( $ this -> customise ( $ data ) ) ; }
Intercepts the handleAction method to force a customised viewer

@param  SS_HTTPRequest $request
@param  string $action
@return string
Intercepts the handleAction method to force a customised viewer