發(fā)表日期:2014-10 文章編輯:小燈 瀏覽次數(shù):3148
在PHPOK4的默認模板中,用戶看到<html><head等相關信息,這里先說明一下,PHPOK對這個函數(shù)進行了封裝
您只要使用頭部使用如下代碼即可
<!--headcss="..."js="..."html5=falseclose=falsetitle=$title-->
我們將對這個代碼進行簡單的說明:
css,指定要加載的CSS信息,默認是不加載任何css的,您可以指定css文件地址,請使用相對地址,程序會先驗證文件是否存在,存在就加載,不存在就嘗試查找css目錄下的文件。如果您的網(wǎng)站啟用了自動改變路徑,請不要擔心,程序也會找相應的文件的。多個CSS文件請用英文逗號隔開!
js,同上類似,不過phpok4中默認會加載framework/config/config.global.php 和 framework/config.config_www.php下的JS文件!同樣,多個JS也請用英文逗號隔開
phpok4默認風格中加載的js有:jQuery1.7.x了,您可以不用再次加載jquery
html5,是否使用HTML5,這里僅僅只是<html的表示方式,默認是支持的,可以不寫
close,是否閉合head,默認是閉合的,如果您還有自己要填寫的head信息,那么可以考慮不閉合
title,定義head里的title信息(這里不包括網(wǎng)站名稱和seo信息,在這個代碼中,SEO是自動加載的)
includejs,包含內置JS,優(yōu)先JS目錄下的js,找不到后,會查找framework/js/下的js,如果還是找不到,就不加載
exclude.js,取消內置JS,適用于手機版減小無用的內置js文件
如果您不喜歡這一行代碼,您完全可以拋棄這個,使用原始的模板代碼:
<!DOCTYPEhtml><html><head><metacharset="utf-8"/><metahttp-equiv="expires"content="Fri,17Jan201402:50:53gmt"/><title><!--if$title-->{$title}-<!--/if-->{$config.title}<!--if$seo.title-->-{$seo.title}<!--/if--></title><basehref="{$sys.url}"/><metahttp-equiv="X-UA-Compatible"content="edge"/><metaname="keywords"content="{$seo.keywords}"/><metaname="description"content="{$seo.description}"/><scripttype="text/javascript"src="{urlctrl=js_noCache=true/}"charset="utf-8"></script><linkrel="stylesheet"type="text/css"href="css/style.css"/></head>
日期:2018-09 瀏覽次數(shù):4163
日期:2014-10 瀏覽次數(shù):3493
日期:2014-10 瀏覽次數(shù):3247
日期:2014-10 瀏覽次數(shù):3330
日期:2014-10 瀏覽次數(shù):3384
日期:2014-10 瀏覽次數(shù):3323
日期:2014-10 瀏覽次數(shù):3397
日期:2014-10 瀏覽次數(shù):3355
日期:2014-10 瀏覽次數(shù):3380
日期:2014-10 瀏覽次數(shù):3410
日期:2014-10 瀏覽次數(shù):3576
日期:2014-10 瀏覽次數(shù):3148
日期:2014-10 瀏覽次數(shù):3297
日期:2014-10 瀏覽次數(shù):3450
日期:2014-10 瀏覽次數(shù):3194
日期:2014-10 瀏覽次數(shù):3723
日期:2014-10 瀏覽次數(shù):3236
日期:2014-10 瀏覽次數(shù):3390
日期:2014-10 瀏覽次數(shù):3210
日期:2014-10 瀏覽次數(shù):3531
日期:2014-10 瀏覽次數(shù):3249
日期:2014-10 瀏覽次數(shù):3273
日期:2014-10 瀏覽次數(shù):3257
日期:2014-10 瀏覽次數(shù):3974
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.