Пример #1
0
 function test_render_throw_on_file_not_found()
 {
     $context = new test_MockContext();
     $template = new k_Template("some/path/which/cant/possibly/exist/../or/so/i/hope");
     try {
         $template->render($context);
         $this->fail("Expected exception not thrown");
     } catch (Exception $ex) {
         $this->pass("Exception caught");
     }
 }
Пример #2
0
 function renderHtml()
 {
     $template = new k_Template(dirname(__FILE__) . '/template.php');
     return $template->render($this);
 }
Пример #3
0
 function renderHtml()
 {
     $t = new k_Template('templates/' . $this->template);
     return $t->render($this, array('collection' => $this->getPaginator(), 'order_asc' => $this->query('order') == 'asc', 'sort' => $this->query('sort'), 'keys' => $this->getKeys(), 'pages' => $this->getPaginator()->getPages()));
 }
Пример #4
0
 function renderHtml()
 {
     $this->document->setTitle('Articles');
     $t = new k_Template('templates/articles-list.tpl.php');
     return $t->render($this, array('articles' => $this->articles->all()));
 }
Пример #5
0
 function renderHtml()
 {
     $this->document->setTitle($this->article->title());
     $t = new k_Template("templates/articles-entity.tpl.php");
     return $t->render($this, array('article' => $this->article));
 }
Пример #6
0
 function renderHtml()
 {
     $this->document->setTitle("Contacts");
     $t = new k_Template("templates/contacts-list.tpl.php");
     return $t->render($this, array('contacts' => $this->contacts->all()));
 }
Пример #7
0
 function renderHtml()
 {
     $this->document->setTitle($this->questionAnswer->question());
     $t = new k_Template('templates/faq-entity.tpl.php');
     return $t->render($this, array('qa' => $this->questionAnswer));
 }
Пример #8
0
 function renderHtml()
 {
     $this->document->setTitle("FAQ");
     $t = new k_Template("templates/faq-list.tpl.php");
     return $t->render($this, array('faq' => $this->faq->all()));
 }
Пример #9
0
 function renderHtmlEdit()
 {
     $this->document->setTitle("Edit " . $this->contact->full_name());
     $t = new k_Template("templates/contacts-entity-edit.tpl.php");
     return new k_HtmlResponse($t->render($this, array('contact' => $this->contact)));
 }
Пример #10
0
 function renderHtml()
 {
     $t = new k_Template("templates/root.tpl.php");
     return $t->render($this);
 }
Пример #11
0
<div id="content-main" style="<?php 
if (!empty($widepicture)) {
    e('background-image: url(' . $widepicture) . ')';
}
?>
">
    <?php 
echo $content;
?>
</div>
<div id="col3">
    <h2>Sidelinjen<em></em></h2>
    <div class="col3inner">
    <?php 
$news = array('nyheder' => VIH_News::getList(2));
$tpl = new k_Template(dirname(__FILE__) . '/News/sidebar-featured.tpl.php');
echo $tpl->render($context, $news);
?>
    </div>
</div>