Skip to content

Instantly share code, notes, and snippets.

@pniederlag
Created March 16, 2011 13:10
Show Gist options
  • Save pniederlag/872466 to your computer and use it in GitHub Desktop.
Save pniederlag/872466 to your computer and use it in GitHub Desktop.
substitute fluid with another templatin engine
<?php
class Tx_Pnphptal_MVC_Controller_ActionController extends Tx_Extbase_MVC_Controller_ActionController {
/**
* Prepares a view for the current action and stores it in $this->view.
* By default, this method tries to locate a view with a name matching
* the current action.
*
* @return void
* @api
*/
protected function resolveView() {
// fb('overriding resolveView');
$view = $this->objectManager->getObject('Tx_Pnphptal_View_TemplateView');
$controllerContext = $this->buildControllerContext();
$view->setControllerContext($controllerContext);
// Template Path Override
$extbaseFrameworkConfiguration = Tx_Extbase_Dispatcher::getExtbaseFrameworkConfiguration();
if (isset($extbaseFrameworkConfiguration['view']['templateRootPath']) && strlen($extbaseFrameworkConfiguration['view']['templateRootPath']) > 0) {
$view->setTemplateRootPath(t3lib_div::getFileAbsFileName($extbaseFrameworkConfiguration['view']['templateRootPath']));
}
if ($view->hasTemplate() === FALSE) {
$viewObjectName = $this->resolveViewObjectName();
if (class_exists($viewObjectName) === FALSE) $viewObjectName = 'Tx_Extbase_MVC_View_EmptyView';
$view = $this->objectManager->getObject($viewObjectName);
$view->setControllerContext($controllerContext);
}
if (method_exists($view, 'injectSettings')) {
$view->injectSettings($this->settings);
}
$view->initializeView(); // In FLOW3, solved through Object Lifecycle methods, we need to call it explicitely
$view->assign('settings', $this->settings); // same with settings injection.
return $view;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment