#1109: Slots & Namespaces
-------------------------+--------------------------------------------------
 Reporter:  anonymous    |       Owner:  david
     Type:  enhancement  |      Status:  new  
 Priority:  normal       |   Milestone:  1.0.2
Component:  view         |     Version:  1.0.1
 Severity:  normal       |    Keywords:       
Has_patch:  0            |  
-------------------------+--------------------------------------------------
 I was recently refactoring an application and decided it would be best to
 use a slot action (CommentView) rather than including a CommentView
 template.

 This is much like how the
 [http://www.agavi.org/documentation/tutorial/step4/slots.html Slots
 Tutorial] shows Posts.

 On the tutorial, the template for showing the Post slots is:
 {{{
 <?php
 foreach ($slots as $slot)
 {
   echo $slot;
 }
 ?>
 }}}

 ... All well and good, but I'm using slots on the page already (not all
 comments). The only solution I've come up with is to prefix my slot names
 and use something like this:

 {{{
 <?php
 foreach ($slots as $key => $slot) {
   if (preg_match('/comment_\d+/', $key))
     echo $slot;
 }
 ?>
 }}}

 I propose there be namespace support added to setSlot() for similar
 situations, where a container has multiple slots of different context.

-- 
Ticket URL: <http://trac.agavi.org/ticket/1109>
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