
批改狀態(tài):合格
老師批語:
define('MY_DATE',date('Y-m-d h:i:s',time()));
// 定義反斜線常量
define('DS', DIRECTORY_SEPARATOR);
//定義根目錄常量
define('ROOT_PATH', $_SERVER['DOCUMENT_ROOT'] .'/0410'.'/web1');
//定義數(shù)據(jù)目錄
define('DATA_PATH', ROOT_PATH.'/Data');
//定義模板目錄
define('TMPL_PATH',ROOT_PATH.'/template');
// 定義公共目錄
define('TMPL_PATH_PUBLIC',TMPL_PATH.'/public');
//定義靜態(tài)資源目錄
define('STATICE_PATH',ROOT_PATH.'/static');
define('STATICE_CSS_PATH',STATICE_PATH.'/css');
define('STATICE_IMAGES_PATH',STATICE_PATH.'/images');
define('STATICE_JS_PATH',STATICE_PATH.'/js');
<?php
require __DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'common.php';
require DATA_PATH . '/data.php';
include TMPL_PATH_PUBLIC. '/header.php';
// var_dump($navArr);
?>
<!-- 主體 -->
<main>
<!-- 新聞列表 -->
<div class="news">
<h3>新聞列表</h3>
<div class="list">
<?php foreach($contentArr as $c): extract($c)?>
<a href="<?php echo $url?>"><?php echo ( mb_strlen($title) > 10 ? mb_substr($title,0,15).'...':$title)?></a>
<?php endforeach?>
</div>
</div>
<!-- 產(chǎn)品列表 -->
<div class="items">
<h3>產(chǎn)品列表</h3>
<div class="list">
<?php
foreach($productArr as $p): extract($p)
?>
<div class="item">
<img src="<?php echo $img?>" alt="<?php echo $title?>" />
<a href="<?=$url?>"><?= mb_strlen($content) > 8?mb_substr($content,0,10).'...':$content?></a>
</div>
<?php endforeach ?>
</div>
</div>
</main>
<!-- 頁腳 -->
<?php
include TMPL_PATH_PUBLIC . '/footer.php';
?>
require __DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'common.php';
require DATA_PATH . '/data.php';
include TMPL_PATH_PUBLIC. '/header.php';
//循環(huán)遍歷產(chǎn)品列表
<div class="list">
<?php foreach($productArr as $p):
extract($p)
?>
<div class="item">
<img src="<?php echo $img?>" alt="<?php echo $title?>" />
<a href="<?=$url?>"><?= mb_strlen($content) > 8?mb_substr($content,0,10).'...':$content?></a>
</div>
<?php endforeach ?>
</div>
require __DIR__ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'common.php';
require DATA_PATH . '/data.php';
include TMPL_PATH_PUBLIC. '/header.php';
//循環(huán)遍歷新聞列表
<div class="list">
<?php foreach($contentArr as $c): extract($c)?>
<a href="<?=$url?>"><?= ( mb_strlen($title) > 10 ? mb_substr($title,0,15).'...':$title) ?></a>
<?php endforeach ?>
</div>
微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號(hào)
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)