Author: weaverryan
Date: 2010-01-30 17:02:03 +0100 (Sat, 30 Jan 2010)
New Revision: 27328
Modified:
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
Log:
[1.4][sfSympalPlugin][1.0] Breaking the logic for getting the slot renderer
into its own function - this gives a little more power and certainly makes
overriding easier.
Modified:
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
===================================================================
---
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
2010-01-30 15:28:18 UTC (rev 27327)
+++
plugins/sfSympalPlugin/trunk/lib/model/doctrine/PluginsfSympalContentSlot.class.php
2010-01-30 16:02:03 UTC (rev 27328)
@@ -102,16 +102,26 @@
{
if (!$this->_rendered)
{
- $contentSlotTypes = sfSympalConfig::get('content_slot_types');
- $className = isset($contentSlotTypes[$this->type]['renderer']) ?
$contentSlotTypes[$this->type]['renderer'] :
'sfSympalContentSlot'.$this->type.'Renderer';
-
- $renderer = new $className($this);
+ $renderer = $this->getSlotRenderer();
$rendered = (string) $renderer;
$this->_rendered =
sfApplicationConfiguration::getActive()->getEventDispatcher()->filter(new
sfEvent($this, 'sympal.content_renderer.filter_slot_content'),
$rendered)->getReturnValue();
}
return $this->_rendered;
}
+
+ /**
+ * Returns an instance of the renderer class for this content slot
+ *
+ * @return sfSympalContentSlotRenderer
+ */
+ public function getSlotRenderer()
+ {
+ $contentSlotTypes = sfSympalConfig::get('content_slot_types');
+ $className = isset($contentSlotTypes[$this->type]['renderer']) ?
$contentSlotTypes[$this->type]['renderer'] :
'sfSympalContentSlot'.$this->type.'Renderer';
+
+ return new $className($this);
+ }
public function setValue($value)
{
--
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.