Author: weaverryan
Date: 2010-01-17 23:51:48 +0100 (Sun, 17 Jan 2010)
New Revision: 26788

Modified:
   plugins/sfSympalPlugin/trunk/config/app.yml
   
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
Log:
allowing a renderer config to be set for a particular content slot type. If 
none is specified, this defaults to building
the class name via the same previous method.


Modified: plugins/sfSympalPlugin/trunk/config/app.yml
===================================================================
--- plugins/sfSympalPlugin/trunk/config/app.yml 2010-01-17 22:48:50 UTC (rev 
26787)
+++ plugins/sfSympalPlugin/trunk/config/app.yml 2010-01-17 22:51:48 UTC (rev 
26788)
@@ -159,6 +159,7 @@
     content_slot_types:
       #MySlotType:
       #  label: Label of My Slot Type
+      #  renderer: sfSympalContentSlotMySlotRenderer
       #  form: MySlotForm (defaults to sfSympalInlineEditContentSlotForm)
       #  widget_class: MySlotTypeWidget (defaults to 
sfWidgetFormSympalMySlotType)
       #  widget_options: []

Modified: 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
===================================================================
--- 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
 2010-01-17 22:48:50 UTC (rev 26787)
+++ 
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
 2010-01-17 22:51:48 UTC (rev 26788)
@@ -98,7 +98,9 @@
   {
     if (!$this->_rendered)
     {
-      $className = 'sfSympalContentSlot'.$this->type.'Renderer';
+      $contentSlotTypes = sfSympalConfig::get('content_slot_types');
+      $className = isset($contentSlotTypes[$this->type]['renderer']) ? 
$contentSlotTypes[$this->type]['renderer'] : 
'sfSympalContentSlot'.$this->type.'Renderer';
+      
       $renderer = new $className($this);
       $rendered = (string) $renderer;
   

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.


Reply via email to