function uncaughtExceptionHandler($e) { logException($e); ob_end_clean(); header('HTTP/1.1 500 Internal Server Error'); ViewRenderer::render('views/errorPage.php', array('exception' => $e)); die; }
public function test() { $renderer = new ViewRenderer(__DIR__ . '/testviews/', ["kGlob" => "vGlob"]); $obj = new \stdClass(); $obj->foo2 = "bar2"; $this->assertEquals('<div>bar_vGlob</div>', $renderer->render('testview.php', ['foo' => 'bar'], $obj)); $this->assertEquals('<div>bar_vGlob</div>', $renderer('testview.php', ['foo' => 'bar'], $obj)); }
$all_member_list = $wdj_mysql_interface->getMemberListByMembershipIdNMemberHashkey($MEETING_MEMBERSHIP_ID, $login_user_info->__member_hashkey); // TODO userid 생성. 번호로 정의되는 member_id는 외부 공격에 위험. // SELECT MD5('testing'); //echo hash('crc32b', 'Wonder Jung'); // @ required $wdj_mysql_interface->close(); ?> <html> <head> <?php // @ required include_once "../../common.js.inc"; $view_render_var_arr = array("[__ROOT_PATH__]" => $service_root_path); ViewRenderer::render("{$file_root_path}/template/head.include.toast-master.mobile.template", $view_render_var_arr); ?> </head> <body role="document"> <table class="table" style="margin-bottom:0px;"> <tbody id="list"> </tbody>
<body role="document"> <!-- nav begins --> <?php $login_user_msg = ""; $login_status = "LOG OUT"; if (!empty($login_user_info) && $login_user_info->__is_login == $params->YES && !empty($login_user_info->__member_hashkey)) { // 로그인 되었을 경우. $login_user_msg = "Welcome! " . $login_user_info->__member_first_name . " " . $login_user_info->__member_last_name; $view_render_var_arr = array("[__ACTIVE_MEETING_AGENDA__]" => "active", "[__MEETING_MEMBERSHIP_ID__]" => $meeting_membership_id, "[__LOG_IN_USER__]" => $login_user_msg, "[__LOG_IN_URL__]" => "{$service_root_path}/view/log_out.php?redirect_url={$service_root_path}/view/meeting_agenda.php?MEETING_ID={$meeting_id}", "[__LOG_IN_STATUS__]" => $login_status, "[__ROOT_PATH__]" => $service_root_path); ViewRenderer::render("{$file_root_path}/template/nav.toast-master.admin.template", $view_render_var_arr); } else { // 로그인되지 않았을 경우. $login_status = "LOG IN"; $view_render_var_arr = array("[__ACTIVE_MEETING_AGENDA__]" => "active", "[__MEETING_MEMBERSHIP_ID__]" => $meeting_membership_id, "[__LOG_IN_URL__]" => "{$service_root_path}/view/log_in.php?redirect_url={$service_root_path}/view/meeting_agenda.php?MEETING_ID={$meeting_id}", "[__LOG_IN_STATUS__]" => $login_status, "[__ROOT_PATH__]" => $service_root_path); ViewRenderer::render("{$file_root_path}/template/nav.toast-master.template", $view_render_var_arr); } // check date is expired $is_expired = $params->YES; $editable_time = date("YmdHis", strtotime("-1 days")); // YYYYMMDDHHmmss // $is_edit_anyway = $params["is_edit_anyway"]; $is_edit_anyway = $params->isYes($params->IS_EDIT_ANYWAY); if ($editable_time < $meeting_agenda_obj->__startdttm || $is_edit_anyway == $params->YES) { $is_expired = $params->NO; } $is_editable = $is_expired == $params->NO && $login_user_info->__member_id > 0 ? $params->YES : $params->NO; ?> <!-- nav ends -->
function putLogonFormFields() { ViewRenderer::render('views/authFormLdap.php'); }
function putLogonFormFields() { ViewRenderer::render('views/authFormPassword.php'); }
/** * Render this view. This function is called by Render() or ReRender() * * @return mixed either print html content or return html content if called by Render(), or void if called by ReRender() */ protected function _render() { $this->setClientScripts(); include_once OPENBIZ_BIN . "/easy/ViewRenderer.php"; return ViewRenderer::render($this); }
<?php require_once 'VewRenderer.php'; echo ViewRenderer::render('index', ['title' => 'Index Super Page', 'objects' => [['name' => 'Sofia', 'population' => 1500000], ['name' => 'Burgas', 'population' => 220000]]], 'layout');
</p> </form> <hr /> </div> <?php if (isset($_POST['fileName'])) { $fileName = $_POST['fileName']; if (!in_array($fileName, $validFileList)) { die('File was not found in the views folder'); } $params = null; // TODO: Why JSON doesn't work? if (isset($_POST['params'])) { $paramStr = explode("\n", $_POST['params']); foreach ($paramStr as $pair) { $pairArr = explode('=', $pair); $pairArr[0] = trim($pairArr[0]); $pairArr[1] = trim($pairArr[1]); if (substr($pairArr[1], 0, 1) == '[' && substr($pairArr[1], -1) == ']') { $params[trim($pairArr[0])] = explode(',', $pairArr[1]); } else { $params[trim($pairArr[0])] = $pairArr[1]; } } } ViewRenderer::render(APP_PATH . '/views/' . $fileName, $params); } ?> </div> </body> </html>
/** * Render this view. This function is called by Render() or ReRender() * * @return mixed either print html content or return html content if called by Render(), or void if called by ReRender() */ protected function _render() { $this->setClientScripts(); if ($this->m_CacheLifeTime > 0) { $pageUrl = $this->curPageURL(); $cache_id = md5($pageUrl); //try to process cache service. $cacheSvc = BizSystem::getService(CACHE_SERVICE, 1); $cacheSvc->init($this->m_Name, $this->m_CacheLifeTime); if ($cacheSvc->test($cache_id)) { BizSystem::log(LOG_DEBUG, "VIEW", "Cache Hit. url = " . $pageUrl); $output = $cacheSvc->load($cache_id); } else { include_once OPENBIZ_BIN . "/easy/ViewRenderer.php"; $this->m_ConsoleOutput = false; $output = ViewRenderer::render($this); BizSystem::log(LOG_DEBUG, "VIEW", "Set cache. url = " . $pageUrl); $cacheSvc->save($output, $cache_id); } print $output; } else { include_once OPENBIZ_BIN . "/easy/ViewRenderer.php"; ViewRenderer::render($this); } return; /* $this->setClientScripts(); include_once(OPENBIZ_BIN."/easy/ViewRenderer.php"); return ViewRenderer::render($this);*/ }