本文整理汇总了PHP中Haanga::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Haanga::load方法的具体用法?PHP Haanga::load怎么用?PHP Haanga::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Haanga
的用法示例。
在下文中一共展示了Haanga::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_league_tabs
function do_league_tabs()
{
global $globals;
$globals['league_base_url'] = $globals['base_url'] . 'admin/league/';
$tabs = array(_('Ligas') => 'index.php', _('Equipos') => 'teams.php', _('Partidos') => 'matches.php');
$links = array();
$self = basename($_SERVER["SCRIPT_NAME"]);
foreach ($tabs as $tab => $page) {
$links[] = array('url' => $globals['league_base_url'] . $page, 'name' => $tab, 'active' => $page == $self);
}
Haanga::load('league/list.tpl', compact('links'));
}
示例2: render
/**
* Render Haanga Template
*
* This method will output the rendered template content
*
* @param string $template The path to the Haanga template, relative to the Haanga templates directory.
* @return string|NULL
*/
public function render($template)
{
return Haanga::load($template, $this->data);
}
示例3: array
<?php
require "../lib/Haanga.php";
#apd_set_pprof_trace('/tmp/apd/');
$config = array('cache_dir' => 'tmp/', 'template_dir' => 'complex/');
if (is_callable('xcache_isset')) {
/* don't check for changes in the template for the next 5 min */
$config['check_ttl'] = 300;
$config['check_get'] = 'xcache_get';
$config['check_set'] = 'xcache_set';
}
Haanga::Configure($config);
$people = array(array('first_name' => 'George </br>', 'last_name' => 'Bush', 'gender' => 'Male', 'foobar' => 'extra'), array('first_name' => 'Bill', 'last_name' => 'Clinton', 'gender' => 'Male'), array('first_name' => 'Margaret', 'last_name' => 'Thatcher', 'gender' => 'Female'), array('first_name' => 'Condoleezza', 'last_name' => 'Rice', 'gender' => 'Female'), array('first_name' => 'Pat', 'last_name' => 'Smith', 'gender' => 'Unknown', 'bar' => 'foo'), array('first_name' => '"Cesar', 'last_name' => 'Rodas"', 'gender' => 'Male'));
$vars = array('some_list' => array(1, 2, 3, 4, 4, 4, 5), 'user' => 'crodas', 'base_template' => 'subtemplate.html', 'people' => $people, 'days' => array(strtotime("01/27/2010"), strtotime("01/28/2010"), strtotime("02/22/2010"), strtotime("02/28/2010"), strtotime("08/25/2010"), strtotime("08/30/2010")), 'templates' => array('base' => 'index-test.html'));
$time = microtime(TRUE);
$mem = memory_get_usage();
Haanga::load('index.html', $vars);
var_dump(array('memory' => (memory_get_usage() - $mem) / (1024 * 1024), 'seconds' => microtime(TRUE) - $time));