使用freamset和fream作分頁網站的好處(thinlphp)

使用frameset分割網頁的話,就不須要爲你網站的二級頁面,在控制器裏寫對應的方法(函數),只須要將全部「跳轉button」的a標籤的href跳轉到index(被你分割的頁面)再加鍵值對,另外還須要在index的方法接收鍵值對,並將鍵值對傳到index.html頁面:php

<!--html 頁面-->
<!--target="_top是必不可少的,否則會出現畫中畫的現象"-->
<a href="__URL__/index?direct=contant" target="_top">contant</a>   
<a href="__URL__/index?direct=home" target="_top">Home</a>


<!--------點擊a標籤則跳轉到下面的php頁面--------------------------------------------------->

/***********php頁面***********/
public function index(){
    $this->assign('direct',$_GET['direct']);
    $this->display();
}

/*********php接收到html頁面的數據,處理即跳轉到index.html***********/

<!----------index.html---------------->

<frameset rows="50px,*" frameborder="no" > 
   <frame src="__URL__/title" name="title" scrolling="no"  noresize/>
   <frame src="__URL__/{$direct}" name="content" frameborder="no"/>
</frameset>
相關文章
相關標籤/搜索