Feature #1501
MVC: initializeView
Status: | Resolved | Start date: | 2008-09-12 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Robert Lemke | % Done: | 100% |
|
Category: | MVC | |||
Target version: | TYPO3 Flow Base Distribution - 1.0 alpha 1 | Estimated time: | 1.00 hour | |
PHP Version: | Complexity: | |||
Has patch: |
Description
Just an idea:
I would like to split the current initializeView into two methods:
detectViewForCurrentAction() (returns a view or emptyView)
initializeView($view) (that initialisze a view with controller context)
That way if required you are also able to set your own view in your action like:
myAction() {
//...some logik
$newView=...
$this->initializeView($newView);
...
Associated revisions
- FLOW3: (MVC) !!! Moved the code from ActionController::initializeView() to resolveView() and introduced a new (empty) initializeView($view) method which can be used to initialize arbitrary views or let developers do some cusomt initialization without having to resolve the view themselves. Resolves #1501
History
#1 Updated by Robert Lemke about 6 years ago
- Target version set to 1.0 alpha 1
#2 Updated by Robert Lemke about 6 years ago
- Status changed from New to Needs Feedback
- Priority changed from Could have to -- undefined --
- Target version changed from 1.0 alpha 1 to 283
What you can do currently is
- setting $this->viewObjectNamePattern
- or setting $this->defaultViewObjectName
- or completely overriding resolveViewObjectName()
Would that help in your case?
#3 Updated by Daniel Poetzinger about 6 years ago
What if in my action one view is not enough?
e.g.:
if (check some thing)
$errorView=get some special view
$this->initializeView($errorView)
$errorView->setMessage(....)
Or if I want to build a composite view in the action?
....
$this->initializeView($initialisedSubView)
$this->view->setSpecialSubView($initialisedSubView);
#4 Updated by Robert Lemke about 6 years ago
- Status changed from Needs Feedback to Accepted
- Priority changed from -- undefined -- to Should have
- Target version changed from 283 to 1.0 alpha 1
#5 Updated by Robert Lemke about 6 years ago
- Status changed from Accepted to Resolved
- % Done changed from 0 to 100
Applied in changeset r2404.