Ticket #60 (closed defect: invalid)

Opened 7 years ago

Last modified 7 years ago

View::importAttributes() works as documented but not as name implies

Reported by: ahmed.lists@… Owned by: bob
Priority: high Milestone:
Component: view Version: HEAD
Severity: minor Keywords:
Cc: Patch attached:

Description

While searching for a one- ot two-lines way to import all request attributes into template while executing the View. I came accross the method View::importAttributes() where i though (as it's name implies) it would do just exactly as i want, but it didn't. Consulting the documentation, it imports request "parameters" not attributes.

Change History

Changed 7 years ago by bob

  • status changed from new to closed
  • resolution set to invalid

Naming is a little confusing.. I'll give you that. However, this is possible in one line, with current code:

(within your View's execute method:)

$this->setAttributes($this->getContext()->getRequest()->getAttributes());

You don't get the benefit of strip_tags and htmlspecialchars, but that's easy enough to add to a method in your own custom View object if you need it. --Bob

Note: See TracTickets for help on using tickets.