queryphp架構發布新版 自動產生html 添加分頁類 圖片處理類解決辦法
來源:互聯網
上載者:User
queryphp架構發布新版 自動產生html 添加分頁類 圖片處理類
目前最新0.9.8版
http://code.google.com/p/queryphp/downloads/list
資料庫分頁類使用
$pager=C("pager");
//setPager(total,pagenum,'page');設定$_GET page變數
//setPager(total,pagenum);
$pager->setPager(100,10,'page');
//可以使用$booktype->count();取得總數
//詳細看curdRouter.class.php檔案
//取得導航html 我們要傳入url其中使用:page代替跟上面setPager()參數中 page 一致
//$pager->getLinks() 取得分頁數組
//$pager->getLinks(5)
/*
*取得連結數組
*返回array(1,2,3,4,5,6)這樣的數組
*foreach($pager->getLinks() as $page)
*echo url_for("/model/action/page/").$page;
*/
$pager->$pager->getBar(url_for("model/action/page/:page"));
/*
*取得帶url連結數組
*key=>value方式
*返回array(1=>url,2=>url,3=>url,4=>url)這樣的數組
*foreach($pager->getBar(url_for("model/action/page/:page")) as $key=>$page)
*echo "".$key."";
*/
print_r($pager->getWholeBar(url_for("default/index/page/:page")));
echo("page:".$pager->offset().":");
庫類檔案使用 漢字轉拼音
$pinyin=C("zh2pinyin");
echo $pinyin->T("開源硬體能否 像開源軟體一樣流行");
echo $pinyin->T("開源硬體能否 像開源軟體一樣流行",true); //true表示刪除中間空格
echo $pinyin->T("開源硬體能否像 開源軟體一樣流行");
產生文字浮水印圖片
C("waterimg")->createWaterPng("浮水印開始");
預設產生config目錄下面
config裡面有一個waterfont.TTF字型是水字型
自動產生html方法
framework\config\inc.ini.php
/*
*網站靜態化開始,可以做seo最佳化
**/
$config['html']='.html';//開啟.html結尾url
$config['realhtml']="/html"; //開啟超級緩衝目錄,如果第一次訪問沒有html頁面自動產生html頁面,第二次訪問時候就是靜態化了
$config['htmlcache']=array("class"=>"sitehtml","method"=>"realhtml"); //產生html檔案類和方法,不設定將不會產生html頁面,
傳入參數為$content,$pathinfo;
/*
*網站靜態化結束
**/
當url地址是index.php時候將不會產生html
http://www.app.com/project/html/curd/index/page/2.html
當沒有index.php時候會自動產生html
產生html檔案會在$config['realhtml']目錄裡面
如果要更新請刪除裡面的html內容
apache配置
Order allow,deny
Allow from all
AllowOverride FileInfo
DocumentRoot "D:/work/queryphp"
ServerName "www.app.com"
把架構解壓到queryphp目錄
------解決方案--------------------
繼續了
呵呵...
------解決方案--------------------
GOOD