load() public static méthode

Load a template from data folder, compile it if it is outdated or not exists
Deprecation: Please use setView(), putContext(), render()
public static load ( string $templateName, array $context = [] ) : string
$templateName string
$context array
Résultat string
 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;
 }
Exemple #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);
 }
Exemple #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;
 }
 public function index()
 {
     $inviteList = \Model\Invite::GetInvitesByUid(-1);
     include Template::load('/home/invite');
 }
 /**
  * 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')));
 }
Exemple #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);
 }
Exemple #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);
 }
Exemple #8
0
 public function ChangePlanLevel()
 {
     global $user;
     include Template::load("panel/changePlanLevel");
 }
Exemple #9
0
 /**
  * 进入首页
  */
 public function index()
 {
     include Template::load('/home/index');
     //throw new \Core\Error("Coming Soon..<br/>", 233);
 }
Exemple #10
0
 /**
  * 进入首页
  */
 public function index()
 {
     include Template::load('/home/index');
 }
Exemple #11
0
 public function Help()
 {
     include Template::load('/home/help');
 }
Exemple #12
0
 /**
  * @Home
  * @Route /Index
  */
 function index()
 {
     include Template::load('Demo');
 }
Exemple #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);
 }
Exemple #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;
 }
Exemple #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);
}
Exemple #16
0
 public function index()
 {
     global $user;
     include Template::load('/admin/index');
 }