示例#1
0
 /**
  * Get the formatted error text
  */
 public function getErrorText($text = "")
 {
     $text = Utils::value($text, "Too many failed attempts.");
     $count = $this->session->get($this->key . ".info.fail_count", 0);
     $total = $this->session->get($this->key . ".info.fail_total", 0);
     $last = $this->session->get($this->key . ".info.last_attempt", 0);
     $keymap = array("attempts" => $total, "countdown" => Numeric::toCountdown($last, $this->cd_time), "count" => "(" . $count . "/" . $this->cd_trigger . ")", "total" => "(" . $total . "/" . $this->max_attempts . ")");
     return Utils::render($text, $keymap);
 }
示例#2
0
 /**
  * Send rendered view object html
  */
 public function sendView($status, $view, $replace = [])
 {
     if ($view instanceof View) {
         $html = $view->render();
         $body = Utils::render($html, Utils::merge($replace, ["load_time" => Server::getLoadTime(@APP_START_TIME), "mem_usage" => Server::getMemUsage()]));
         $this->sendHtml($status, $body);
     }
     $this->sendHtml($status, "Empty response.");
 }