當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Templates::getVar方法代碼示例

本文整理匯總了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">
開發者ID:GIDIX,項目名稱:quicktalk,代碼行數:31,代碼來源:header.php

示例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> &rsaquo;

		<?php 
echo $topic->getTitle();
?>
	</h1>

	<div id="forum">
		<div id="topic">
			<?php 
foreach ($posts as $post) {
    $i++;
    ?>
開發者ID:GIDIX,項目名稱:quicktalk,代碼行數:31,代碼來源:viewtopic.php

示例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();
開發者ID:GIDIX,項目名稱:quicktalk,代碼行數:31,代碼來源:viewforum.php

示例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 
}
開發者ID:GIDIX,項目名稱:quicktalk,代碼行數:31,代碼來源:user.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();
        ?>
開發者ID:GIDIX,項目名稱:quicktalk,代碼行數:31,代碼來源:forums.php

示例6:

<?php

Templates::display('header');
echo Templates::getVar('customContent');
Templates::display('footer');
開發者ID:GIDIX,項目名稱:quicktalk,代碼行數:5,代碼來源:custom.php


注:本文中的Templates::getVar方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。