Feature #1501

MVC: initializeView

Added by Daniel Poetzinger about 13 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
MVC
Start date:
2008-09-12
Due date:
% Done:

100%

Estimated time:
1.00 h
PHP Version:
Has patch:
Complexity:

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);

...

#1

Updated by Robert Lemke over 12 years ago

  • Target version set to 1.0 alpha 1
#2

Updated by Robert Lemke over 12 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 over 12 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 over 12 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 over 12 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r2404.

Also available in: Atom PDF