本文整理汇总了PHP中Templates::getVar方法的典型用法代码示例。如果您正苦于以下问题:PHP Templates::getVar方法的具体用法?PHP Templates::getVar怎么用?PHP Templates::getVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Templates
的用法示例。
在下文中一共展示了Templates::getVar方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
?>
</div>
<div class="avatar">
<img src="<?php
echo ThemeFunctions::getUserAvatar();
?>
" alt="Avatar" />
</div>
</div>
</aside>
</div>
<div id="header_wrap">
<header>
<div class="logo">
<img src="/images/quicktalk/wide_translucent_fordark.svg" alt="<?php
echo Templates::getVar('pageTitle');
?>
" />
</div>
<nav>
<?php
echo ThemeFunctions::getNavigation();
?>
</nav>
</header>
</div>
<div id="content">
示例2:
<?php
Templates::display('header');
$forum = Templates::getVar('forum');
$topic = Templates::getVar('topic');
$posts = Templates::getVar('posts');
$pages = Templates::getVar('pages');
$i = 0;
?>
<h1>
<a href="<?php
echo URLController::get($forum);
?>
">
<?php
echo $forum->getTitle();
?>
</a> ›
<?php
echo $topic->getTitle();
?>
</h1>
<div id="forum">
<div id="topic">
<?php
foreach ($posts as $post) {
$i++;
?>
示例3:
<?php
Templates::display('header');
$forum = Templates::getVar('forum');
$topics = Templates::getVar('topics');
?>
<h1><?php
echo $forum->getTitle();
?>
</h1>
<div id="forum">
<div class="topics">
<?php
if (count($topics) == 0) {
?>
<div class="nothing">
<h2><?php
echo ForumT::get('no_topics');
?>
</h2>
</div>
<?php
}
foreach ($topics as $topic) {
?>
<div class="topic">
<div class="icon"><img src="<?php
echo Templates::getThemeURL();
示例4:
<?php
Templates::display('header');
$profileUser = Templates::getVar('profileUser');
?>
<!-- End Content -->
</div>
<div id="profile">
<div class="profile_header_wrap">
<header>
<div class="avatar">
<img src="<?php
echo $profileUser->getAvatar();
?>
" alt="Avatar" />
</div>
<div class="meta">
<h1><?php
echo $profileUser->getUsername();
?>
</h1>
<?php
if ($profileUser->isOnline()) {
?>
<?php
}
示例5: foreach
<?php
Templates::display('header');
?>
<h1>Forums</h1>
<div id="forum">
<?php
foreach (Templates::getVar('categories') as $category) {
?>
<div class="category">
<h2><?php
echo $category->getTitle();
?>
</h2>
<div class="forums">
<?php
$forums = $category->getForums();
foreach ($forums as $forum) {
?>
<div class="forum">
<div class="icon"><img src="<?php
echo Templates::getThemeURL();
?>
images/icons/topics/<?php
echo $forum->getIcon();
?>
示例6:
<?php
Templates::display('header');
echo Templates::getVar('customContent');
Templates::display('footer');