public function format($text, $context, $user = null, $extraData = [])
    {
        $data = $this->getTemplateData($context, $user, $extraData);

        // render
        $viewer = new SSViewer_FromString($text);
        try {
            $string = $viewer->process($data);
        } catch (Exception $e) {
            $string = $text;
        }

        return $string;
    }
public function format($text, $context, $user = null, $extraData = [])
    {
        $data = $this->getTemplateData($context, $user, $extraData);

        // render
        $viewer = new SSViewer_FromString($text);
        try {
            $string = $viewer->process($data);
        } catch (Exception $e) {
            $string = $text;
        }

        return $string;
    }
public function format ( $ text , $ context , $ user = null , $ extraData = [ ] ) { $ data = $ this -> getTemplateData ( $ context , $ user , $ extraData ) ; // render $ viewer = new SSViewer_FromString ( $ text ) ; try { $ string = $ viewer -> process ( $ data ) ; } catch ( Exception $ e ) { $ string = $ text ; } return $ string ; }
Format text with given keywords etc
@param  string     $text
@param  DataObject $context
@param  Member     $user
@param  array      $extraData
@return string
Format text with given keywords etc