本文整理汇总了PHP中WPFB_Core::CreateTplFunc方法的典型用法代码示例。如果您正苦于以下问题:PHP WPFB_Core::CreateTplFunc方法的具体用法?PHP WPFB_Core::CreateTplFunc怎么用?PHP WPFB_Core::CreateTplFunc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WPFB_Core
的用法示例。
在下文中一共展示了WPFB_Core::CreateTplFunc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
wpfb_loadclass('File', 'Category', 'Output');
extract($args);
$title = apply_filters('widget_title', $instance['title']);
echo $before_widget, $before_title . (empty($title) ? __('Files', WPFB) : $title) . $after_title;
// special handling for empty cats
if (!empty($instance['cat']) && !is_null($cat = WPFB_Category::GetCat($instance['cat'])) && $cat->cat_num_files == 0) {
$instance['cat'] = array();
foreach ($cat->GetChildCats() as $c) {
$instance['cat'][] = $c->cat_id;
}
}
$files = WPFB_File::GetFiles2(empty($instance['cat']) ? null : WPFB_File::GetSqlCatWhereStr($instance['cat']), WPFB_Core::$settings->hide_inaccessible, array($instance['sort-by'] => $instance['sort-asc'] ? 'ASC' : 'DESC'), (int) $instance['limit']);
//$instance['tpl_parsed']
//WPFB_FileListWidget
$tpl_func = WPFB_Core::CreateTplFunc($instance['tpl_parsed']);
echo '<ul>';
foreach ($files as $file) {
echo '<li>', $tpl_func($file), '</li>';
}
echo '</ul>';
echo $after_widget;
}
示例2: GenTpl2
function GenTpl2($tpl_tag = null, $load_js = true)
{
static $tpl_funcs = array('file' => array(), 'cat' => array());
if (empty($tpl_tag)) {
$tpl_tag = 'default';
}
if ($load_js) {
WPFB_Core::$load_js = true;
}
$type = $this->is_file ? 'file' : 'cat';
if (empty($tpl_funcs[$type][$tpl_tag])) {
$parsed_tpl = WPFB_Core::GetParsedTpl($this->is_file ? 'file' : 'cat', $tpl_tag);
if (empty($parsed_tpl)) {
return "Template {$type} :: {$tpl_tag} does not exist!";
}
$tpl_funcs[$type][$tpl_tag] = WPFB_Core::CreateTplFunc($parsed_tpl);
}
self::$tpl_uid = defined('DOING_AJAX') && DOING_AJAX ? $this->GetId() . '' . round(microtime() * 1000) % 1000 : self::$tpl_uid + 1;
return $tpl_funcs[$type][$tpl_tag]($this);
}
示例3: GenTpl2
function GenTpl2($tpl_tag = null, $load_js = true)
{
static $tpl_funcs = array('file' => array(), 'cat' => array());
if (empty($tpl_tag)) {
$tpl_tag = 'default';
}
if ($load_js) {
WPFB_Core::$load_js = true;
}
$type = $this->is_file ? 'file' : 'cat';
if (empty($tpl_funcs[$type][$tpl_tag])) {
$parsed_tpl = WPFB_Core::GetParsedTpl($this->is_file ? 'file' : 'cat', $tpl_tag);
if (empty($parsed_tpl)) {
return "Template {$type} :: {$tpl_tag} does not exist!";
}
$tpl_funcs[$type][$tpl_tag] = WPFB_Core::CreateTplFunc($parsed_tpl);
}
self::$tpl_uid++;
return $tpl_funcs[$type][$tpl_tag]($this);
}