Feature #2852

Improve viewObjectName determination

Added by Bastian Waidelich almost 12 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
MVC
Start date:
2009-03-16
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
Complexity:

Description

Currently \F3\FLOW3\MVC\Controller\ActionController either calls resolveViewObjectName() or uses $this->viewObjectName to determine the view object name.
That means that you'll have to create a view for every action in your controller, or you set $viewObjectName to a general view class. But you can't have both, e.g. use F3\Fluid\View\TemplateView for all actions and your own views for ajax-requests (e.g. @format = 'json').

A possible solution could be:
rename $this->viewObjectName to $this->defaultViewObjectName in ActionController and always check, whether there exists a custom implementation first.

Also available in: Atom PDF