<?php
/**
* Story Template filter interface
*
* Rewrite elements in a story template
*
*/
abstract class AnModelStoryTemplateFilterAbstract extends KObject
{
/**
* Parse a text based on the data provided by a story object
* @return
* @param $text Object
* @param $story AnModelStory
*/
abstract public function parse(&$text, $tokens, $story);
/**
* Replace a token with a value within a text
* @param $text string
* @param $token string
* @param $value string
*/
protected function _replace(&$text, $token, $value)
{
$text = str_replace('${'.$token.'}', (string) $value, $text);
}
}