本文整理汇总了PHP中template::output方法的典型用法代码示例。如果您正苦于以下问题:PHP template::output方法的具体用法?PHP template::output怎么用?PHP template::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类template
的用法示例。
在下文中一共展示了template::output方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: page
function page()
{
$user = $this->f3->get("user");
$catID = $this->f3->get("PARAMS['catID']");
$category = models\categories::getInstance()->get($catID);
$categories = $this->f3->get("categories");
$c = array();
foreach ($categories as $item) {
$c["ID-" . $item['ID']] = $item;
}
$this->catparents($category, $c);
$this->breadcrumb = array_reverse($this->breadcrumb);
$parentIDs = array();
foreach ($this->breadcrumb as $item) {
$parentIDs[] = $item['ID'];
}
$category['parentIDs'] = $parentIDs;
// test_array($c);
$items = array("suggested" => models\items::format(models\items::getInstance()->getAll("catID='{$category['ID']}' AND recommended='1'", "name ASC")), "other" => models\items::format(models\items::getInstance()->getAll("catID='{$category['ID']}' AND recommended='0'", "name ASC")));
$relationships = array();
if ($category['relationship']) {
$relationships = models\categories::getInstance()->getAll("dir_categories.ID in ({$category['relationship']}) OR parentID='{$category['ID']}'");
}
// test_array($relationships);
// test_array($category);
// test_array(array("breadcrumbs"=>$this->breadcrumb,"categories"=>$c));
$tmpl = new \template("template.twig");
$tmpl->page = array("section" => "categories", "sub_section" => $category['ID'], "template" => "list_category", "meta" => array("title" => "Directory | {$category['category']}"), "css" => "", "js" => "");
$tmpl->breadcrumb = $this->breadcrumb;
$tmpl->category = $category;
$tmpl->related = $relationships;
$tmpl->items = $items;
$tmpl->output();
}
示例2: show
function show($view, $loc = null, $title = '')
{
$template = new template('searchmodule', $view, $loc);
$template->assign('loc', $loc);
$template->register_permissions(array('administrate', 'configure'), $loc);
$template->output();
}
示例3: show
function show($view, $loc = null, $title = '')
{
if (exponent_permissions_check('administrate', $loc) || exponent_permissions_check('create', $loc) || exponent_permissions_check('edit', $loc) || exponent_permissions_check('delete', $loc)) {
$template = new template('HTMLTemplateModule', $view, $loc);
$template->assign('noupload', 0);
$template->assign('uploadError', '');
if (!defined('SYS_FILES')) {
include_once BASE . 'subsystems/files.php';
}
$directory = 'files/HTMLTemplateModule/' . $loc->src;
if (!file_exists(BASE . $directory)) {
$err = exponent_files_makeDirectory($directory);
if ($err != SYS_FILES_SUCCESS) {
$template->assign('noupload', 1);
$template->assign('uploadError', $err);
}
}
global $db;
$templates = $db->selectObjects('htmltemplate');
for ($i = 0; $i < count($templates); $i++) {
$assocs = $db->selectObjects('htmltemplateassociation', 'template_id=' . $templates[$i]->id);
if (count($assocs) == 1 && $assocs[0]->global == 1) {
$templates[$i]->global_assoc = 1;
} else {
$templates[$i]->global_assoc = 0;
$templates[$i]->associations = $assocs;
}
}
$template->assign('moduletitle', $title);
$template->assign('templates', $templates);
$template->register_permissions(array('administrate', 'create', 'edit', 'delete'), exponent_core_makeLocation('HTMLTemplateModule'));
$template->output();
}
}
示例4: page
function page()
{
$user = $this->f3->get("user");
//$categories = $this->f3->get("categories");
//$categories = models\categories::format($categories,true);
//test_array($categories);
$items = models\items::format(models\items::getInstance()->getAll("gps_long!='' AND gps_lat!=''"));
$item_json = array();
foreach ($items as $item) {
$photo = "";
if ($item['photo']) {
$photo = "<img alt='' src='/thumbnail/110/90?crop=false&file=/files/{$item['photo']}' class='img-thumbnail' />";
}
$str = "";
if ($item['phone']) {
$str = $str . "<em class='dg'>Phone:</em> " . $item['phone'] . "<br>";
}
if ($item['website']) {
$str = $str . "<em class='dg'>Website:</em> " . $item['website'] . "<br>";
}
$item_json[] = array("ID" => $item['ID'], "placeTitle" => $item['name'], "tooltip" => '<div class="scrollFix"><strong>' . $item["name"] . '</strong><br><div>
<div class="c" style="margin:10px;">' . $photo . '</div><div>' . $str . '</div></div>', "url" => "/item/{$item['ID']}/{$item['url']}", "lat" => $item['gps_lat'], "lng" => $item['gps_long']);
}
// test_array($item_json);
$tmpl = new \template("template.twig");
$tmpl->page = array("section" => "map", "sub_section" => "map", "template" => "map", "meta" => array("title" => "Directory | Map"), "css" => "", "js" => "http://maps.google.com/maps/api/js");
$tmpl->item_json = json_encode($item_json);
$tmpl->output();
}
示例5: show
function show($view, $loc = null, $title = '')
{
$template = new template('LoginModule', $view, $loc);
$template->assign('title', $title);
if (exponent_sessions_loggedIn()) {
global $user, $db;
$template->assign('loggedin', 1);
$template->assign('user', $user);
// Generate display name as username if the first and last name fields are blank.
$display_name = $user->firstname . ' ' . $user->lastname;
if (trim($display_name) == '') {
$display_name = $user->username;
}
$template->assign('displayname', $display_name);
// Need to check for groups and whatnot
if ($db->countObjects('groupmembership', 'member_id=' . $user->id . ' AND is_admin=1')) {
$template->assign('is_group_admin', 1);
} else {
$template->assign('is_group_admin', 0);
}
} else {
$template->assign('loggedin', 0);
}
$template->output($view);
}
示例6: page
function page()
{
$user = $this->f3->get("user");
$tmpl = new \template("template.twig");
$tmpl->page = array("section" => "about", "sub_section" => "about", "template" => "about", "meta" => array("title" => "Directory | About Us"), "css" => "", "js" => "");
$tmpl->output();
}
示例7: page
function page()
{
$user = $this->f3->get("user");
$tmpl = new \template("template.twig", "app/admin/");
$tmpl->page = array("section" => "home", "sub_section" => "home", "template" => "home", "meta" => array("title" => "Directory | Admin | Home"), "css" => "", "js" => "");
$tmpl->output();
}
示例8: page
function page()
{
$user = $this->f3->get("user");
$tmpl = new \template("template.twig", "app/admin/");
$tmpl->page = array("section" => "items", "sub_section" => "items", "template" => "items", "meta" => array("title" => "Directory | Admin | Items"), "css" => "", "js" => "http://maps.google.com/maps/api/js");
$tmpl->output();
}
示例9: page
function page()
{
$user = $this->f3->get("user");
$tmpl = new \template("template.twig");
$tmpl->page = array("section" => "items", "sub_section" => "items", "template" => "_items", "meta" => array("title" => "Directory | Items"), "css" => "", "js" => "");
$tmpl->items = models\items::format(models\items::getInstance()->getAll());
$tmpl->output();
}
示例10: page
function page()
{
$user = $this->f3->get("user");
$categories = models\categories::getInstance()->getAll("", "category ASC");
$tmpl = new \template("template.twig", "app/admin/");
$tmpl->page = array("section" => "categories", "sub_section" => "categories", "template" => "categories", "meta" => array("title" => "Directory | Admin | Categories"), "css" => "", "js" => "");
$tmpl->categories = $categories;
$tmpl->output();
}
示例11: show
function show($view, $loc = null, $title = "")
{
$loc = exponent_core_makeLocation('FileManagerModule');
global $db;
$collections = $db->selectObjects('file_collection');
$template = new template('FileManagerModule', $view, $loc);
$template->assign('collections', $collections);
$template->output();
}
示例12: page
function page()
{
$user = $this->f3->get("user");
$cfg = $this->cfg;
$page = isset($_GET['page']) ? $_GET['page'] : '1';
//test_array($articles);
$tmpl = new \template("template.twig");
$tmpl->page = array("section" => "home", "sub_section" => "home", "template" => "home", "meta" => array("title" => "Home Page"), "css" => "", "js" => "");
$tmpl->output();
}
示例13: template
function send_template_mail($to, $subject, $template, $headers = null)
{
$this->using('template');
$param =& $this->using('param');
$tpl = new template();
$template = explode('/', $template);
$tpl->load(TM_TEMPLATES_DIR . C_TEMPLATE . '/layout/views/' . $template[0] . '/' . $template[1]);
$tpl->set($param->get_params(), true);
$message = $tpl->output();
$this->send_mail($to, $subject, $message, null, $headers);
}
示例14: show
function show($view, $loc = null, $title = '')
{
$ui_levels = exponent_sessions_get('uilevels');
if (count($ui_levels)) {
$template = new template('UISwitchermodule', $view, $loc);
$template->assign('levels', $ui_levels);
$default = exponent_sessions_isset('uilevel') ? exponent_sessions_get('uilevel') : max(array_keys($ui_levels));
$template->assign('default_level', $default);
$template->output();
}
}
示例15: page
function page()
{
$user = $this->f3->get("user");
$pageID = $this->f3->get("PARAMS['pageID']");
$data = models\pages::getInstance()->get($pageID);
//test_array($pageID);
$tmpl = new \template("template.twig", "app/admin/");
$tmpl->page = array("section" => "pages", "sub_section" => "page{$pageID}", "template" => "pages", "meta" => array("title" => "Directory | Admin | Pages"), "css" => "", "js" => "");
$tmpl->data = $data;
$tmpl->pageID = $pageID;
$tmpl->output();
}