本文整理匯總了PHP中template::instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP template::instance方法的具體用法?PHP template::instance怎麽用?PHP template::instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類template
的用法示例。
在下文中一共展示了template::instance方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInstance
public static function getInstance()
{
if (is_null(self::$instance)) {
self::$instance = new Singleton();
}
return self::$instance;
}
示例2: getInstance
/**
* Creation/Recuperation de la class template
*
* @param string $name
* @return template
*/
static function getInstance($name = null)
{
if (is_null(template::$instance) && !is_null($name)) {
template::$instance = new template($name);
}
return template::$instance;
}
示例3: getInstance
static function getInstance()
{
if (is_null(template::$instance)) {
template::$instance = new template();
}
return template::$instance;
}
示例4: mf_AssignMessages
/**
*
*/
protected function mf_AssignMessages()
{
$this->tpl = template::instance();
$this->tpl->assign('arrMessageLevels', $this->m_arrMessageLevels);
$arrMsgs = $this->mf_GetMessages();
arsort($arrMsgs['level'], SORT_NUMERIC);
$arrMessages = array();
foreach ($arrMsgs['level'] as $k => $iLevel) {
$arrMessages[] = array('level' => $iLevel, 'msg' => $arrMsgs['msg'][$k]);
}
$this->tpl->assign('arrMessages', $arrMessages);
$szMessages = 0 < count($arrMessages) ? $this->tpl->fetch('messages.tpl.html') : '';
$this->tpl->assign('szMessages', $szMessages);
unset($this->tpl->smarty->_tpl_vars['arrMessages'], $this->tpl->smarty->_tpl_vars['arrMessageLevels']);
}
示例5: contest
private static function contest($year)
{
return \template::instance()->render($year . '/index.html');
}