/** * Display Template */ public function render() { // extract the variables for view pages extract($this->_variables); // the view path $path = MyHelpers::UrlContent('~/views/'); // start buffering ob_start(); // render page content if (empty($this->viewPath)) { include $path . $this->_controller . DS . $this->_action . '.php'; } else { include $this->viewPath; } // get the body contents $this->_bodyContent = ob_get_contents(); // clean the buffer ob_end_clean(); // check if we have any layout defined if (!empty($this->layout) && !MyHelpers::isAjax()) { // we need to check the path contains app prefix (~) $this->layout = MyHelpers::UrlContent($this->layout); // start buffer (minify pages) ob_start('MyHelpers::minify_content'); // include the template include $this->layout; } else { ob_start('MyHelpers::minify_content_js'); // just output the content echo $this->_bodyContent; } // end buffer ob_end_flush(); }
/** * unknownAction */ public function unknownAction($params = array()) { // feed 404 header to the client header("HTTP/1.0 404 Not Found"); // find custom 404 page $path = MyHelpers::UrlContent("~/views/shared/_404.php"); // if we have custom 404 page, then use it if (file_exists($path)) { $this->view->viewPath = $path; return $this->view(); } else { exit; //Do not do any more work in this script. } }
?> </div> <!-- Footer --> <div id="footer"> <div class="content"> <div class="col"> <h2>Footer 1</h2> <?php include MyHelpers::UrlContent('~/views/shared/_text1Part.php'); ?> </div> <div class="col"> <h2>Footer 2</h2> <div class="contact"> <?php include MyHelpers::UrlContent('~/views/shared/_text1Part.php'); ?> </div> </div> </div> <div class="content"> <div id='copyright'> <p> <span> Copyright © <script type='text/javascript'> var creditsyear = new Date();document.write(creditsyear.getFullYear()); </script> <a href='<?php echo $cfg['site']['address']; ?>