#1146: Have AgaviRequestDataHolder implement ArrayAccess
-------------------------+--------------------------------------------------
 Reporter:  saracen      |       Owner:  david
     Type:  enhancement  |      Status:  new  
 Priority:  normal       |   Milestone:  1.0.2
Component:  request      |     Version:  1.0.1
 Severity:  normal       |    Keywords:       
Has_patch:  0            |  
-------------------------+--------------------------------------------------
 Summary is quite self-explanatory, so I'll jump straight to the reasons:

 I find myself doing this a lot in multiple views for one action, so that I
 can access a parameter in my templates.
 {{{
 $this->setAttribute('user', $rd->getParameter('user'));
 }}}

 I know you can access the request data via $rd in templates, but it gets
 messy when dealing with arrays and objects (which get exported from my
 validators):
 {{{
 // Current way #1
 echo $rd->getParameter('user')->getName();

 // Current way #2
 $user = $rd->getParameter('user');
 echo $user['name'];

 // Enhanced way #1
 echo $rd['user']->getName();

 // Enhanced way #2
 echo $rd['user']['name'];
 }}}

-- 
Ticket URL: <http://trac.agavi.org/ticket/1146>
Agavi <http://www.agavi.org/>
An MVC Framework for PHP5



_______________________________________________
Agavi Tickets Mailing List
[email protected]
http://lists.agavi.org/mailman/listinfo/tickets

Reply via email to