Home > Uncategorized > show一段用Lafe写的代码

show一段用Lafe写的代码

July 18th, 2011
  1. class Layout_My_Layout extends Base_Layout{
  2.     function build(){
  3.         if($ua->isPc) $this->pc->display();
  4.         else if($ua->isPad) $this->pad->display();
  5.         else if($ua->isPhone) $this->phone->display();
  6.     }
  7.     public function layout_pc(){
  8.         $main_body = "left_2_right_3_5.Right";
  9.         $side_bar = "left_2_right_3_5.Left";
  10.  
  11.         if($ua->userReverse){
  12.             $main_body = "left_3_right_2_5.Left"; //用户选择把side_bar放在右边的设置
  13.             $side_bar = "left_3_right_2_5.Right";
  14.         }
  15.  
  16.         $this->{'Header common_header'} = $headder_data;
  17.         $this->{"Body $main_body main_panel"} = $side_data;
  18.         $this->{"Body $side_bar side_panel"} = $right_data;
  19.         $this->{'Footer common_footer'} = $footer_data;
  20.     }
  21.     public function layout_pad(){
  22.         ......
  23.     }
  24.     public function layout_phone(){
  25.         ......
  26.     }
  27. }

Uncategorized

  1. 王涛
    July 18th, 2011 at 17:11 | #1

    Lafe是什么语言?

  2. July 18th, 2011 at 18:11 | #2

    看上一篇,呵呵~

  3. September 18th, 2011 at 00:08 | #3

    请问想交换友情链接怎么弄?

  4. October 28th, 2012 at 22:20 | #4

    看完代码有点感觉了,哈哈,谢谢博主分享