作者j87b0003 (邱老虎)
看板PHP
标题Re: [请益] 物件导向的一个写法
时间Tue Aug 31 17:21:18 2010
怎不分开写?
不知道以下这样写是不是你要的,
不过我个人不喜欢就是了...
class grid {
private $head_data; //标题列的资料
private $rows_data; //资料列的资料
public $head_html;
public $body_html;
public function create_grid($heads, $bodys){
$this->head_html = $heads;
$this->body_html = $bodys;
$html = $heads.$bodys;
return $this;
}
public function get_head(){
return $this->head_html;
}
}
改了红色部份
--
以恶
治恶
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.56.138.224