Created
February 3, 2012 11:23
-
-
Save micha149/1729738 to your computer and use it in GitHub Desktop.
Teaser Cache Callback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds additional data to teaser cache | |
* | |
* | |
* Each Teaser will now contain the following: | |
* array(3) { | |
* [name] => | |
* string(7) "Michael" | |
* [id] => | |
* int(2) 47 | |
* [content] => | |
* string(4711) "<div><p>Rendered by selected teaser template…" | |
* } | |
*/ | |
class Some_Callback | |
{ | |
public static function onTeaserCache(Teaser_Cache_Event $event, array $params) | |
{ | |
$wrap = $event->getWrap(); | |
$event->addData('name', $wrap->find('name')->getValue('content')); | |
$event->addData('id', $event->getTid()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment