コード例 #1
0
 /**
  * ส่งออกเป็น HTML
  *
  * @param string|null $template HTML Template ถ้าไม่กำหนด (null) จะใช้ index.html
  */
 public function renderHTML($template = null)
 {
     // maintenance detail
     $template = ROOT_PATH . DATA_FOLDER . 'maintenance.' . Language::name() . '.php';
     if (is_file($template)) {
         $template = trim(preg_replace('/<\\?php exit([\\(\\);])?\\?>/', '', file_get_contents($template)));
     } else {
         $template = '<p style="padding: 20px; text-align: center; font-weight: bold;">Website Temporarily Closed for Maintenance, Please try again in a few minutes.<br>ปิดปรับปรุงเว็บไซต์ชั่วคราวเพื่อบำรุงรักษา กรุณาลองใหม่ในอีกสักครู่</p>';
     }
     parent::setContents(array('/{TITLE}/' => self::$cfg->web_title, '/{CONTENT}/' => $template));
     return parent::renderHTML(file_get_contents(ROOT_PATH . 'skin/empty.html'));
 }
コード例 #2
0
 /**
  * ส่งออกเป็น HTML
  *
  * @param string|null $template HTML Template ถ้าไม่กำหนด (null) จะใช้ index.html
  */
 public function renderHTML($template = null)
 {
     // intro detail
     $template = ROOT_PATH . DATA_FOLDER . 'intro.' . Language::name() . '.php';
     if (is_file($template)) {
         $template = trim(preg_replace('/<\\?php exit([\\(\\);])?\\?>/', '', file_get_contents($template)));
     } else {
         $template = '<p style="padding: 20px; text-align: center; font-weight: bold;"><a href="index.php">Welcome<br>ยินดีต้อนรับ</a></p>';
     }
     parent::setContents(array('/{TITLE}/' => self::$cfg->web_title, '/{CONTENT}/' => $template));
     return parent::renderHTML(file_get_contents(ROOT_PATH . 'skin/empty.html'));
 }
コード例 #3
0
ファイル: ViewTest.php プロジェクト: goragod/kotchasan
 /**
  * Generated from @assert ('module=retmodule') [==] "http://localhost/?module=retmodule&amp;page=1&amp;sort=id" [[$_SERVER['QUERY_STRING'] = '_module=test&_page=1&_sort=id']].
  *
  * @covers Kotchasan\View::back
  */
 public function testBack2()
 {
     $_SERVER['QUERY_STRING'] = '_module=test&_page=1&_sort=id';
     $this->assertEquals("http://localhost/?module=retmodule&amp;page=1&amp;sort=id", \Kotchasan\View::back('module=retmodule'));
 }
コード例 #4
0
 /**
  * ouput เป็น HTML.
  *
  * @param string|null $template HTML Template ถ้าไม่กำหนด (null) จะใช้ index.html
  * @return string
  */
 public function renderHTML($template = null)
 {
     // เนื้อหา
     parent::setContents(array('/{LOGIN}/' => method_exists('Index\\Login\\Controller', 'init') ? \Index\Login\Controller::init(Login::isMember()) : '', '/{WIDGET_([A-Z]+)(([_\\s]+)([^}]+))?}/e' => '\\Gcms\\View::getWidgets(array(1=>"$1",3=>"$3",4=>"$4"))', '/{BREADCRUMBS}/' => implode('', $this->breadcrumbs), '/{FONTSIZE}/' => '<a class="font_size small" title="{LNG_change font small}">A<sup>-</sup></a><a class="font_size normal" title="{LNG_change font normal}">A</a><a class="font_size large" title="{LNG_change font large}">A<sup>+</sup></a>', '/{VERSION}/' => self::$cfg->version, '/{ELAPSED}/' => round(microtime(true) - REQUEST_TIME, 4), '/{QURIES}/' => \Kotchasan\Database\Driver::queryCount()));
     return parent::renderHTML($template);
 }