本章构建一个Page类,它代表了一个页面。其中有显示页面的title,样式,内容等函数。
此页面的效果如下:
我们将把这个页面分成几块:
1)有图的那一块。
2)有导航按钮的那一块。
3)中间文字的一会
4)页底的这一块
具体看看代码吧:
{
private $line2buttons=array('PHP'=>'PHP.php','Apache HTTP Server'=>'Apache.php',
'MySql'=>'mysql.php','Zend Studio'=>'ZendStudio.php',
'UEStudio'=>'http://www.ultraedit.com');
public function DisplayPage()
{
print "<html>\n<header>";
$this->DisplayTitle();
$this->DisplayStyles();
print "</header>\n<body>";
$this->DisplayHeader();
$this->DisplayMenus($this->buttons);
$this->DisplayMenus($this->line2buttons);
$this->DisplayContent();
$this->DisplayFooter();
print "</body>\n</html>";
}
}
$page=new ProductPage();
$page->content="本页面用来测试我们最先进的产品!这些产品正在测试中,很快将会粉墨登场!请耐心等待";
$page->DisplayPage();