PHP Classes

File: tinyMVC/lib/StringView.class.php

Recommend this page to a friend!
  Packages of Alan H. Lake   tinyMVC   tinyMVC/lib/StringView.class.php   Download  
File: tinyMVC/lib/StringView.class.php
Role: Class source
Content type: text/plain
Description: RestView implementation for a view
Class: tinyMVC
MVC based Web application framework
Author: By
Last change: Added path to File Name. Added code to Contents.
Date: 16 years ago
Size: 538 bytes
 

 

Contents

Class file image Download
// 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 ;
    }
}
?>