Esempio n. 1
0
 /**
  * Oops, there is an error of some kind.
  */
 public function error($route)
 {
     $page = new \Sleepy\Template('global');
     $page->bind('error', $route->params['error']->getMessage());
     require_once 'app/views/home-500.php';
     $page->show();
 }
Esempio n. 2
0
 function testIncludeMissing()
 {
     $this->expectException(new Exception("Template './templates/binding.tpl' does not exist."));
     $t = new \Sleepy\Template();
     $t->directory = "./templates/";
     $t->setTemplate('binding');
     $t->show();
 }
Esempio n. 3
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/app/core/sleepy.php';
$page = new \Sleepy\Template('homepage');
// SEO
$page->bind('title', 'Sleepy Mustache');
$page->bind('description', 'This is the description');
$page->bind('keywords', 'blog, sleepy mustache, framework');
// Content
$page->bind('header', 'sleepy<span>MUSTACHE</span>');
$page->bind('teasers', array(array("title" => "Getting Started", "link" => 'http://www.sleepymustache.com/', "author" => "Jaime A. Rodriguez", "date" => date('m/d/Y', time()), "description" => "\n\t\t\t\tCongratulations on successfully installing sleepyMUSTACHE! You can visit the <a href=\"http://www.sleepymustache.com/documentation/index.html\">documentation page</a> to learn more or hit the ground running by viewing the <a href=\"http://www.sleepymustache.com/#getting-started\">getting started</a> section.", "tags" => array(array('name' => "Configuration", 'link' => "http://www.sleepymustache.com/#getting-started"))), array("title" => "Sample Modules", "link" => "#", "author" => "Jaime A. Rodriguez", "date" => date('m/d/Y', time() - 30 * 24 * 60 * 60), "description" => "\n\t\t\t\tBy default there are 2 sample modules included with the\n\t\t\t\tframework. These modules demonstrate how to create your own\n\t\t\t\tmodules, and implement existing functionality. You may safely\n\t\t\t\tdelete them.", "tags" => array(array('name' => "modules", 'link' => "http://www.sleepymustache.com/#default-modules"), array('name' => "fixes", 'link' => "https://github.com/jaimerod/sleepy-mustache/commits/master")))));
$page->show();