[TYPO3-mvc] Reusing View

Jonas Eberle jonas.eberle at d-mind.de
Tue Nov 4 15:32:44 CET 2014


Am 23.09.2014 um 10:15 schrieb Bernhard Schenkenfelder:
> Since the layout is really the same, I would like to reuse the the 
> list view in searchAction(). Is there a way to specify the view 
> (template) to be used?
I just came across the same problem where I needed to dynamically switch 
templates.

In the controller action, I do

if(is_a($this->view,'\TYPO3\CMS\Fluid\View\TemplateView')) {
     $this->view->setTemplatePathAndFilename($templatePathAndFilename);
}



Cheers, Jonas


More information about the TYPO3-project-typo3v4mvc mailing list