00001 <?php
00002 require_once dirname(__FILE__) . '/viewbase.cls.php';
00003
00004
00005
00006
00007
00008
00009
00010 class ContentViewBase extends ViewBase {
00011
00012
00013
00014
00015
00016 protected $page_data = null;
00017
00018
00019
00020
00021 public function __construct($name, $page_data) {
00022 parent::__construct($name, '');
00023 if (empty($page_data)) {
00024 throw new Exception('ContentView called with empty PageData');
00025 }
00026 $this->page_data = $page_data;
00027 }
00028
00029 public function render($policy = self::NONE) {
00030 $ret = parent::render($policy);
00031 $this->page_data->content = $ret;
00032 return $ret;
00033 }
00034
00035
00036
00037
00038
00039
00040 protected function assign_default_vars($policy) {
00041 parent::assign_default_vars($policy);
00042 $this->assign('page_data', $this->page_data);
00043 if ($this->page_data->router) {
00044 $this->assign('route_id', $this->page_data->router->get_route_id());
00045 }
00046 }
00047
00048
00049
00050
00051
00052
00053 public function get_page_data() {
00054 return $this->page_data;
00055 }
00056 }