Home >Backend Development >PHP Tutorial >不能确定这段代码在Framework 上如何工作

不能确定这段代码在Framework 上如何工作

WBOY
WBOYOriginal
2016-06-23 14:12:531268browse

php html framework

多谢诸位。

新到公司, 在Framework MVC 上看到如下代码,看不大懂是不是php,是如何工作的,请教一下。


page.header.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head>	<title>{C::$DOMAIN} - {$config.title}</title>	<link rel="stylesheet" type="text/css" href="{$CSS_URL}" />	<script src="{$JS_URL}"></script>	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /></head><body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">	{if ($debug)}	<div id="debug">		<div id="debug_menu">			<a href="#" id="sql_button">SQL ({count($sql_log)})</a>			<a href="#" id="dump_button">DUMP ({count($dump)})</a>			<a href="#" id="profile_button">Profile ({$profile.time})</a>		</div>		<div class="profile_record">			Time: {$profile.time} sec.<br>			Memory: {$profile.memory} bytes		</div>		{foreach name=dump from=$dump item=item}			<div class="dump_record{if ($smarty.foreach.dump.index % 2)} odd{/if}">Dump: {$item.file}:{$item.line}<br>{$item.dump|nl2br}</div>		{/foreach}		{foreach name=sql_log from=$sql_log item=item}			<div class="sql_record{if ($smarty.foreach.sql_log.index % 2)} odd{/if}">Time {$item.time}, {$item.records} records: <br> {$item.query|nl2br}{if ($item.data)} <br><br>{var_dump($item.data)|escape}{/if}</div>		{/foreach}	</div>	{/if}	<div class="pageTitle"><h1>XYZ - {$config.title}</h1></div>	<div class="page" id="{$config.name}">		<div class="pageHeader">			<a name="top"></a>			<a href=/><div class="logo"></div></a>			{if ($user->logged())}			<iframe id="iframefix" src="#" frameborder="0" scrolling="no"></iframe>			<div class="menu">				<ul class="dropdown">					<li class="left">						<a href="{$ROOT_URL}/">Home</a>					</li>					{if ($user->can_page('users|edituser|editrole'))}					<li class="left">						<a href="javascript:void(0)">Users</a>						<ul class="sub_menu">							{if ($user->can_page('users'))}								<li><a href="{$ROOT_URL}/users.html">Users and Roles</a></li>							{/if}							{if ($user->can_page('edituser'))}								<li><a href="{$ROOT_URL}/edituser.html">Add User</a></li>							{/if}							{if ($user->can_page('editrole'))}								<li><a href="{$ROOT_URL}/editrole.html">Add Role</a></li>							{/if}						</ul>					</li>					{/if}					{if ($user->can_page('warnings'))}					<li class="left" style="background: red">						{if ($user->can_page('warnings'))}							<a href="{$ROOT_URL}/warnings.html">Warnings</a>						{/if}					</li>					{/if}					{if ($user->can_page('signal_monitoring'))}					<li class="left">						{if ($user->can_page('signal_monitoring_map'))}							<a href="{$ROOT_URL}/signal_monitoring_map.html">Signal Monitoring</a>						{/if}					</li>					{/if}					<li class="right">						<a href="{$ROOT_URL}/login.html?adminloginform__logout=1">Logout ({$user->getLogin()})</a>					</li>					<li class="right">						<a href="#">   Help   </a>						<ul class="sub_menu">							{if ($user->can_page('faq'))}								<li><a href="{$ROOT_URL}/faq.html">FAQ</a></li>							{/if}							{if ($user->can_page('editrole'))}								<li><a href="{$ROOT_URL}/bandwidth.html">Bandwidth calculator</a></li>							{/if}						</ul>					</li>				</ul>				{/if}			</div>		</div>		<div class="pageContents">			<div class="contents">				{if ($message_success)}					<div class="message_success">{$message_success}</div>				{/if}




page.footer.html
		</div> <!-- /contents -->    </div> <!-- /wrapper -->    <div class=footer>		Bell ExpressVu (c)    </div></body></html>

回复讨论(解决方案)

应该不是HTML吧,HTML应该不支持
{if ($condition)}.............{/if}

{foreach name=sql_log from=$sql_log item=item}................{/foreach}

应该是 PHP,我猜 "!=" 也能工作,但不知为什么能这么写,同问!

smarty 模版!!

参考smarty手册!

http://www.smarty.net/

Smarty3 手册

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn