load() 공개 정적인 메소드

Load a template from data folder, compile it if it is outdated or not exists
사용 중단: Please use setView(), putContext(), render()
public static load ( string $templateName, array $context = [] ) : string
$templateName string
$context array
리턴 string
예제 #1
0
 public function Lockscreen()
 {
     global $user;
     if (isset($_POST['email']) && isset($_POST['passwd'])) {
         $result = array("status" => 0, "message" => "验证失败");
         $passwd = htmlspecialchars($_POST['passwd']);
         $result['passwd'] = $passwd;
         $user = User::getInstance();
         $user = $user->GetUserByEmail($user->email);
         $result['obj'] = $user;
         if ($user->verifyPassword($passwd)) {
             Util::setToken();
             $result['status'] = 1;
             $result['message'] = "验证成功, 将跳转到 >> 仪表盘";
         } else {
             $result['message'] = "我跟你讲, 你密码错的在试2遍就给你锁了.";
         }
         echo json_encode($result);
         exit;
     } else {
         if (!\Helper\Listener::checkLogin()) {
             \Core\Response::redirect('/Auth/login');
             exit;
         }
         include Template::load('/panel/lockscreen');
     }
     exit;
 }
예제 #2
0
 /**
  * Common layout for project views
  *
  * @access protected
  * @param  string    $template   Template name
  * @param  array     $params     Template parameters
  * @return string
  */
 protected function projectLayout($template, array $params)
 {
     $content = $this->template->load($template, $params);
     $params['project_content_for_layout'] = $content;
     $params['title'] = $params['project']['name'] === $params['title'] ? $params['title'] : $params['project']['name'] . ' > ' . $params['title'];
     $params['board_selector'] = $this->projectPermission->getAllowedProjects($this->acl->getUserId());
     return $this->template->layout('project/layout', $params);
 }
예제 #3
0
 public function JsonList()
 {
     global $user;
     $id = trim($_REQUEST['id']);
     $nodeList = Nodem::GetNodeArray();
     $info = "";
     foreach ($nodeList as $node) {
         $info .= NodeUtil::NodeJson($node->server, $node->port, $user->sspwd, $node->method) . ",";
     }
     include Template::load('/node/JsonAll');
     exit;
 }
예제 #4
0
 public function index()
 {
     $inviteList = \Model\Invite::GetInvitesByUid(-1);
     include Template::load('/home/invite');
 }
예제 #5
0
 /**
  * Get the mail content for a given template name
  *
  * @access public
  * @param  string    $template    Template name
  * @param  array     $data        Template data
  */
 public function getMailContent($template, array $data)
 {
     $tpl = new Template();
     return $tpl->load('notification/' . $template, $data + array('application_url' => $this->config->get('application_url')));
 }
예제 #6
0
 /**
  * Get the event html content
  *
  * @access public
  * @param  array     $params    Event properties
  * @return string
  */
 public function getContent(array $params)
 {
     $tpl = new Template();
     return $tpl->load('event_' . str_replace('.', '_', $params['event_name']), $params);
 }
예제 #7
0
 /**
  * Get the mail content for a given template name
  *
  * @access public
  * @param  string    $template    Template name
  * @param  array     $data        Template data
  */
 public function getMailContent($template, array $data)
 {
     $tpl = new Template();
     return $tpl->load($template, $data);
 }
예제 #8
0
 public function ChangePlanLevel()
 {
     global $user;
     include Template::load("panel/changePlanLevel");
 }
예제 #9
0
 /**
  * 进入首页
  */
 public function index()
 {
     include Template::load('/home/index');
     //throw new \Core\Error("Coming Soon..<br/>", 233);
 }
예제 #10
0
 /**
  * 进入首页
  */
 public function index()
 {
     include Template::load('/home/index');
 }
예제 #11
0
 public function Help()
 {
     include Template::load('/home/help');
 }
예제 #12
0
 /**
  * @Home
  * @Route /Index
  */
 function index()
 {
     include Template::load('Demo');
 }
예제 #13
0
 /**
  * Common layout for project views
  *
  * @access protected
  * @param  string    $template   Template name
  * @param  array     $params     Template parameters
  * @return string
  */
 protected function projectLayout($template, array $params)
 {
     $content = $this->template->load($template, $params);
     $params['project_content_for_layout'] = $content;
     return $this->template->layout('project_layout', $params);
 }
예제 #14
0
 /**
  * Show text and redirect to another page
  * @param string $text Content
  * @param string $link Target page
  * @param int $timeout Time before redirect
  */
 public static function show($text, $link = null, $timeout = 3)
 {
     $link = Response::generateURL($link);
     include Template::load('Misc/Redirect');
     exit;
 }
예제 #15
0
/**
 * Load a template
 *
 * @param  string    $name    Template name
 * @param  array     $args    Template parameters
 * @return string
 */
function template($name, array $args = array())
{
    $tpl = new Template();
    return $tpl->load($name, $args);
}
예제 #16
0
 public function index()
 {
     global $user;
     include Template::load('/admin/index');
 }