本文整理匯總了PHP中BaseView::fetch方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseView::fetch方法的具體用法?PHP BaseView::fetch怎麽用?PHP BaseView::fetch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BaseView
的用法示例。
在下文中一共展示了BaseView::fetch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fetch
/**
* @param string $tplFile
*/
protected function fetch($tplFile)
{
if (DAGGER_TEMPLATE_ENGINE === 'smarty') {
$tpl = new BaseViewSmarty();
} else {
$tpl = new BaseView();
}
$tpl->assign($this->view);
return trim($tpl->fetch($tplFile));
}
示例2: getPageStr
/**
* 構造翻頁字符串
* @return string 返回翻頁頁碼html代碼
*/
public function getPageStr()
{
if (DAGGER_TEMPLATE_ENGINE === 'smarty') {
$tpl = new BaseViewSmarty();
} else {
$tpl = new BaseView();
}
$assign = array('totalPage' => $this->totalPage, 'pageSize' => $this->pageSize, 'prePage' => $this->prePage, 'nextPage' => $this->nextPage, 'firstPage' => $this->firstPage, 'lastPage' => $this->lastPage, 'totalNum' => $this->totalNum, 'pName' => $this->pName, 'page' => $this->page, 'paramStr' => $this->paramStr);
$format = isset($_REQUEST['format']) ? $_REQUEST['format'] : '';
switch ($format) {
case 'xml':
case 'json':
return !$this->totalPage ? array() : $assign;
break;
default:
foreach ($assign as $key => $val) {
$tpl->assign($key, $val);
}
$style = intval($this->style);
return !$this->totalPage ? '' : $tpl->fetch('page/style_' . $style . '.html');
}
}