【精粹】架構合理+強大的PHP架構再次推薦,傲視群雄~

來源:互聯網
上載者:User
【精華】架構合理+強大的PHP架構再次推薦,傲視群雄~~~~
樣本展示

PHP code
display("lizi1.html");         }         //擷取配置項         public function getC(){             $this->assign('cdata',C('static_url'));             $this->display('c.html');         }         //跳轉方法         public function jump(){             $this->redirect("Index/lizi1.html");         }         //增加資料,常規操作         public function adddata(){             $data['title']='ChangShu';             $this->add($data,"demo");             $this->redirect("Index/lizi1.html");         }         //更新資料         public function savedata(){             $data['title']='ChangShu2';             $this->save($data,"demo",1);             $this->redirect("Index/lizi1.html");         }         //尋找單條資料集         public function finddata(){             $data=$this->find("demo","string",1);             $this->assign('data',$data);             $this->display('find.html');         }         //尋找資料集合         public function seldata(){             $data=$this->select("select * from demo where id between 1 and 3");             $this->assign('data',$data);             $this->display('sel.html');         }         //刪除資料,略         //資料表執行個體化操作         public function tadd(){             $u=T("demo");             $u->title='nantong';             $u->add();             $this->redirect("Index/lizi1.html");         }         //執行個體化更新資料         public function tsave(){             $u=T("demo");             $u2=$u->find(1);             $u2->title='SUZHOU';             $u2->save();             $this->redirect("Index/lizi1.html");         }         //尋找資料集,,集合等等,省略,,參閱中文手冊         //多語言,要修改lng/lang.php         public function lang(){             $this->display('lang.html');         }         //驗證方法,要修改Model/Model.php         public function vali(){             $data='';             //$data="hell";             if(match($data,"title")){                 $this->redirect("Index/lizi1.html");             }         }         //二維數組調用函數,使用common/common.php         public function common(){             $u=T("demo");             $data=$u->select("1,2,3");             $this->assign('data',$data);             $this->display("common.html");         }         //大型複雜項目迴圈數組運算使用,注意$this->array_array  $this->array_two的用法           public function dophp(){             $data=$this->select("select * from demo");             $this->assign('data',$data);             $this->display('fuza.html');         }}?>


――――――――――――――――――――――――――――――――――――――――――――――――
lizi1.html 偽靜態配置
HTML code
    這是一個偽靜態樣本,具體實現參考代碼。。    


在conf/config.php中設定 'static_url'=>'.html',

―――――――――――――――――――――――――――――――――――――――――――――――――

c.html 擷取配置項
HTML code
輸出值為:{cdata}


其中 {cdata} 輸出模板變數

――――――――――――――――――――――――――――――――――――――――――――――――
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.