public function render($arguments)
 {
     PageRenderer::addTemplatesLocation(__DIR__ . "/../templates");
     Permissions::need("exceptions");
     PageRenderer::header(array("title" => t("Exception list"), "id" => "page_exception_list"));
     $limit = isset($arguments['limit']) ? $arguments['limit'] : 10;
     $class = isset($arguments['limit']) ? $arguments['limit'] : null;
     $important = isset($arguments['important']) ? $arguments['important'] : null;
     $ignored = isset($arguments['ignored']) ? $arguments['ignored'] : null;
     $q = db()->prepare("SELECT * FROM uncaught_exceptions ORDER BY id desc LIMIT " . (int) $limit);
     $q->execute();
     $exceptions = $q->fetchAll();
     PageRenderer::requireTemplate("exception_list", array("exceptions" => $exceptions, "url" => url_for($this->getPath(), array("limit" => $limit, "class" => $class, "important" => $important, "ignored" => $ignored))));
     PageRenderer::footer();
 }
Example #2
0
 function generateFile($template, $object, $args = array())
 {
     $filename = $object->getFilename();
     $title = $object->getTitle($this->options);
     $_file = $this->output . $filename;
     $this->logger->info("Generating '{$_file}'...");
     ob_start();
     $args['options'] = $this->options;
     $args['database'] = $this->database;
     $args['logger'] = $this->logger;
     $args['generator'] = $this;
     PageRenderer::header(array("title" => $title));
     PageRenderer::requireTemplate($template, $args);
     PageRenderer::footer();
     $contents = ob_get_contents();
     ob_end_clean();
     file_put_contents($_file, $contents);
 }
Example #3
0
/**
 * Use {@link PageRenderer#requireTemplate} without having to declare the namespace
 * in a template as well.
 */
function require_template($id, $args = array())
{
    PageRenderer::requireTemplate($id, $args);
}
Example #4
0
<?php

use Pages\PageRenderer;
PageRenderer::header(array("title" => t("Contact"), "id" => "page_contact"));
PageRenderer::requireTemplate("contact");
PageRenderer::footer();
Example #5
0
<?php

/**
 * A simple calculator to calculate the value of one currency in another currency.
 */
use Pages\PageRenderer;
define('__TEMPLATE_DIR__', __DIR__);
PageRenderer::header(array("title" => t("Cryptocurrency Calculator"), "id" => "page_calculator", "js" => "calculator"));
PageRenderer::requireTemplate("calculator");
PageRenderer::footer();
Example #6
0
function require_template($template_id, $arguments = array())
{
    global $tree;
    $arguments += array('tree' => $tree);
    \Pages\PageRenderer::requireTemplate($template_id, $arguments);
}