本文整理匯總了PHP中FrontendTemplate::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP FrontendTemplate::getName方法的具體用法?PHP FrontendTemplate::getName怎麽用?PHP FrontendTemplate::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FrontendTemplate
的用法示例。
在下文中一共展示了FrontendTemplate::getName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: parseCredit
protected function parseCredit($objItem)
{
global $objPage;
$objCredit = new FileCreditHybridModel();
$objCredit = $objCredit->findRelatedByCredit($objItem, $this->arrPids);
if (is_null($objCredit)) {
return null;
}
$objTemplate = new \FrontendTemplate('filecredit_default');
$objTemplate->setData($objCredit->file->row());
// TODO
$objTemplate->link = $this->generateCreditUrl($objCredit);
$objTemplate->linkText = $GLOBALS['TL_LANG']['MSC']['creditLinkText'];
// TODO
if ($objCredit->page === null && $objCredit->result->usage) {
$objTemplate->pageTitle = $objCredit->result->usage;
} else {
$objTemplate->pageTitle = $objCredit->page->pageTitle ? $objCredit->page->pageTitle : $objCredit->page->title;
}
// colorbox support
if ($objPage->outputFormat == 'xhtml') {
$strLightboxId = 'lightbox';
} else {
$strLightboxId = 'lightbox[' . substr(md5($objTemplate->getName() . '_' . $objCredit->file->id), 0, 6) . ']';
}
$objTemplate->attribute = $strLightboxId ? ($objPage->outputFormat == 'html5' ? ' data-gallery="#gallery-' . $this->id . '" data-lightbox="' : ' rel="') . $strLightboxId . '"' : '';
return $objTemplate->parse();
}
示例2: createBlockWrapper
public static function createBlockWrapper($objBlock, $strContent)
{
$objT = new \FrontendTemplate($objBlock->customTpl ? $objBlock->customTpl : 'blocks_wrapper');
$objT->block = $strContent;
$arrCssID = deserialize($objBlock->featureActive ? $objBlock->feature_cssID : $objBlock->cssID, true);
$arrSpace = deserialize($objBlock->space);
$arrStyle = array();
if ($arrSpace[0] != '') {
$arrStyle[] = 'margin-top:' . $arrSpace[0] . 'px;';
}
if ($arrSpace[1] != '') {
$arrStyle[] = 'margin-bottom:' . $arrSpace[1] . 'px;';
}
$objT->style = !empty($arrStyle) ? implode(' ', $arrStyle) : '';
$objT->class = trim($objT->getName() . ' ' . $arrCssID[1]);
$objT->cssID = $arrCssID[0] != '' ? ' id="' . $arrCssID[0] . '"' : '';
$objT->blockTpl = $objBlock->customBlockTpl ? $objBlock->customBlockTpl : 'block_searchable';
$arrHeadline = deserialize($objBlock->headline);
$objT->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline;
$objT->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1';
return $objT->parse();
}