Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

json-template.inc.php

Go to the documentation of this file.
00001 <?
00009 class JSONTemplate extends BaseTemplate
00010 {
00014     public function drawPage()
00015     {
00016         //draw our errors...
00017         if ($this->object->hasError())
00018             $this->drawError();
00019         //nope, what about status?.
00020         else if ($this->object->hasStatus())
00021             $this->drawStatus();
00022         //finally we get to content!
00023         else    
00024             $this->drawContent();
00025     }
00026     
00027     public function drawError()
00028     {
00029         echo JSON::encode(
00030             array(
00031                 'error' => $this->object->getError()
00032             )
00033         );
00034     }
00035 
00036     public function drawStatus()
00037     {
00038         echo JSON::encode(
00039             array(
00040                 'status' => $this->object->getStatus()
00041             )
00042         );
00043     }
00044 }
00045 ?>

Generated on Fri Oct 27 12:26:40 2006 for BaseJumper by doxygen 1.3.9.1