// Allows for passing of a string from the controller to a view.
<?
// For use with RestServer
class StringView implements RestView {

    function __construct($str,$inserts=array())
    {
        if(count($inserts) > 0) {
            foreach($inserts as $key => $value) {
                $str = str_replace($key,$value,$str);
            }
        }
        $this->str = $str;
    }

    function show(RestServer $rest)
    {
        $rest->getResponse()->setResponse($this->str);
        return $rest ;
    }
}
?>
