本文整理汇总了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();
}