Beispiel #1
0
 /**
  *
  */
 public function render()
 {
     if ($this->destroyAllCookies) {
         if (isset($_SERVER['HTTP_COOKIE'])) {
             $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
             foreach ($cookies as $cookie) {
                 $parts = explode('=', $cookie);
                 $name = trim($parts[0]);
                 $this->cookies[] = new Cookie($name, '', time() - 1);
             }
         }
     } elseif (count($this->cookiesToDestroy) > 0) {
         foreach ($this->cookiesToDestroy as $name) {
             $this->cookies[] = new Cookie($name, '', time() - 1);
         }
     }
     if (!$this->redirected) {
         if ($this->cancelCache) {
             if (trim($this->cache) != '' && $this->cacheExists($this->cache)) {
                 $this->destroyCache($this->cache);
             }
             $this->cache = '';
         }
         if (trim($this->cache) != '' && file_exists($this->cache) && !$this->cancelCache) {
             $content = ob_get_contents();
             ob_end_clean();
             return $content;
         }
         foreach ($this->parameters as $name => $value) {
             ${$name} = $value;
         }
         $allMessages = $this->messages['All'];
         $errorMessages = $this->messages[Message::Error];
         $warningMessages = $this->messages[Message::Warning];
         $informationMessages = $this->messages[Message::Information];
         $successMessages = $this->messages[Message::Success];
         $templateVariables = $this->parameters;
         $template = templatePath($this->template);
         if (file_exists($template) && !is_dir($template)) {
             $templateName = $this->template;
             require_once $template;
         } else {
             if (file_exists($this->template) && !is_dir($this->template)) {
                 $templateName = $this->template;
                 require_once $this->template;
             } else {
                 require_once 'lightwork/json.php';
             }
         }
         $contents = ob_get_contents();
         ob_end_clean();
         if (trim($this->cache) != '' && !$this->cancelCache && !file_exists($this->cache)) {
             $fileHandler = new FileHandler();
             $fileHandler->writeFile($this->cache, $label . $contents);
         }
         return $contents;
     }
 }
Beispiel #2
0
			<div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
				<article>
					<div class="main">
						<header>
							<h1><img src="<?php 
imgUrl('lightwork.png');
?>
" alt="<?php 
metaTitle();
?>
"/></h1>
							<h2>Well, this is 404 page...</h2>
						</header>
						<section>
							<?php 
include templatePath('messages.php');
?>
							<div>
								<p>
									It means that the server wasn't able to find the resource you're looking for <?php 
if (isset($_REQUEST['action'])) {
    echo "(<em>{$_REQUEST['action']}</em>)";
}
?>
. 
									Try these:
								</p>
								<ul>
									<li>Be sure you typed the right URL.</li>
									<li>Also, check you '<em>config/actions.json</em>' file.</li>
									<li>Lastly, take a look on your <em>.htaccess</em> file.</li>
Beispiel #3
0
 /**
  * ### Includes an extending template
  *
  * @param $tpl
  */
 public function extend($tpl)
 {
     $path = templatePath($tpl);
     include $path;
 }