本文整理匯總了PHP中Gdn_Theme::assetBegin方法的典型用法代碼示例。如果您正苦於以下問題:PHP Gdn_Theme::assetBegin方法的具體用法?PHP Gdn_Theme::assetBegin怎麽用?PHP Gdn_Theme::assetBegin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Gdn_Theme
的用法示例。
在下文中一共展示了Gdn_Theme::assetBegin方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: htmlspecialchars
?>
<!-- Robots should not see the dashboard, but tell them not to index it just in case. -->
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body id="<?php
echo htmlspecialchars($BodyIdentifier);
?>
" class="<?php
echo $this->CssClass;
?>
">
<?php
$this->renderAsset('Symbols');
// TODO: Pull this asset out elsewhere
Gdn_Theme::assetBegin('DashboardUserDropDown');
$user = Gdn::session()->User;
$rm = new RoleModel();
$roles = $rm->getByUserID(val('UserID', $user))->resultArray();
$roleTitlesArray = [];
foreach ($roles as $role) {
$roleTitlesArray[] = val('Name', $role);
}
$roleTitles = implode(', ', $roleTitlesArray);
/** var UserController $user */
?>
<div class="card card-user">
<?php
$userBlock = new MediaItemModule(val('Name', $user), userUrl($user), $roleTitles, '', ['class' => 'card-block']);
$userBlock->setView('media-sm')->setImage(userPhotoUrl($user))->addButton(t('My Profile') . ' ' . dashboardSymbol('external-link', 'icon-11 icon-text'), userUrl($user), ['class' => 'btn btn-sm-rounded btn-secondary padded-top']);
echo $userBlock;
示例2: helpAsset
/**
* Formats a help element and adds it to the help asset.
*
* @param $title
* @param $description
*/
function helpAsset($title, $description)
{
Gdn_Theme::assetBegin('Help');
echo '<aside role="note" class="help">';
echo wrap($title, 'h2', ['class' => 'help-title']);
echo wrap($description, 'div', ['class' => 'help-description']);
echo '</aside>';
Gdn_Theme::assetEnd();
}