PHP Classes

File: tinyMVC/lib/FrameView.class.php

Recommend this page to a friend!
  Classes of Alan H. Lake   tinyMVC   tinyMVC/lib/FrameView.class.php   Download  
File: tinyMVC/lib/FrameView.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 comment to Contents.
Date: 14 years ago
Size: 627 bytes
 

Contents

Class file image Download
// Combines the contents of a frame file with the main page code for creating a view.
<?
// For use with RestServer
class FrameView implements RestView {

    function
__construct($page_code,$frame_file='')
    {
        if(
strlen($frame_file) > 0) {
           
$frame_code = file_get_contents($frame_file);
           
$this->whole_page = str_replace('%contents%',$page_code,$frame_code);
        }else{
           
$this->whole_page = $page_code;
        }
    }

    function
show(RestServer $rest)
    {
       
$rest->getResponse()->setResponse($this->whole_page);
        return
$rest ;
    }
}
?>