示例#1
0
 public function init()
 {
     try {
         $this->header('Content-Type: text/html');
     } catch (RequestHeadersAlreadySent $e) {
     }
     $this->theme = $this->appInstance->config->defaulttheme->value;
     $this->components = new Components($this);
     $this->startTime = microtime(true);
     $this->tpl = $this->appInstance->getQuickyInstance();
     $this->tpl->assign('req', $this);
 }
示例#2
0
 /**
  * @param string $block
  * @param string $email
  * @param $args
  */
 public function mailTemplate($block, $email, $args)
 {
     $args['domain'] = $this->appInstance->config->domain->value;
     $this->appInstance->renderBlock($block, $args, function ($result) use($email) {
         $result = str_replace("\r", '', $result);
         $e = explode("\\\n\\\n", $result, 2);
         $e[0] = str_replace("\n", "\r\n", $e[0]);
         $e[0] = preg_replace('~^\\\\r\\n~ms', '', $e[0]);
         $subject = preg_match('~^Subject: (.*)$~mi', $e[0], $m) ? $m[1] : '';
         $this->mail($email, $subject, $e[1], $e[0]);
     });
 }