日期:2014-05-17  浏览次数:20555 次

不能确定这段代码在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>