github github
  • Home
  • Pricing and Signup
  • Training
  • Gist
  • Blog
  • Login

diogok / restserver

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 6
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: b1e641c

click here to add a description

click here to add a homepage

  • Switch Branches (1)
    • master
  • Switch Tags (0)
  • Branch List
Sending Request…

RESTful resource/url mapping and MVC, featuring Request an Response objects. — Read more

  Cancel

http://www.phpclasses.org/browse/package/5080.html

  Cancel
  • HTTP
  • Git Read-Only

This URL has Read+Write access

Fixed redundant methods RestRequest::getInput and getBody and RestResponse::addResponse appendResponse, now they chain call the newer method. Did not removed duplicated due to backward compatibility and stuff like that. This is my longest commit message so far... 
diogok (author)
Thu Aug 12 17:07:00 -0700 2010
commit  b1e641c05d5d507d5810
tree    4326a6d862cc927adfc9
parent  330617e443421d5647aa
restserver / GenericView.class.php GenericView.class.php
Txt 100755 38 lines (32 sloc) 0.888 kb
  • edit
  • raw
  • blame
  • history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php

/**
* Class GenericView
* A GenericView representation, throws the result of a script into the Response
*/
class GenericView implements RestView {

    protected $file ;
    protected $props ;

    /**
* Constructor of GenericView
* @param string $file The script to be rendered
* @param mixed $props Vars to be passed to the script
*/
    function __construct($file=null,$props=null) {
        if($file != null) $this->file = $file ;
        if($props != null) $this->props = $props ;
    }

    /**
* Render the selected script
* @param RestServer $rest
* @return RestServer
*/
    function show(RestServer $rest) {
        ob_start();
        $params = $this->props ;
        include $this->file ;
        $content = ob_get_clean();
        $rest->getResponse()->setResponse($content);
        return $rest ;
    }

}
?>

Dedicated Server Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
  • Blog
  • Support
  • Training
  • Job Board
  • Shop
  • Contact
  • API
  • Status
  • © 2010 GitHub Inc. All rights reserved.
  • Terms of Service
  • Privacy
  • Security
  • English
  • Deutsch
  • Français
  • 日本語
  • Português (BR)
  • 中文
  • See all available languages

Your current locale selection: English. Choose another?

  • English
  • Afrikaans
  • Català
  • Čeština
  • Deutsch
  • Español
  • Français
  • Hrvatski
  • Indonesia
  • Italiano
  • 日本語
  • Nederlands
  • Norsk
  • Polski
  • Português (BR)
  • Српски
  • Svenska
  • 中文