Linux 設定方式:
在 php.ini 中找到 include_path
將include_path 修改如下:
include_path = ".:/php/includes:/usr/share/pear"
然後重新啟動 apache
/etc/rc.d/init.d/httpd restart
完成!
Happy PEAR!
2009年1月2日 星期五
Smarty & CSS
Smarty 也是在web design 常用到的樣版引擎
入門教學可以看 Jace Ju 的 Smarty 入門
不過我在一開始設定css 跟 php 時就遇到了大問題
我的php 檔案一直跑不出來我所設定的css樣式
後來幾經研究
發現解決方案有下列幾種:
1. 重設分隔符號
在 include {smarty.class.php} 的檔案中加入:
$tpl-> left_delimiter = '[ ';
$tpl-> right_delimiter= ']'';來改變左右分隔符號
2. 加入 {literal}
用{literal} {/literal} 包住
如果以上兩個方法都不成功的話
就代表是你的css 路徑設錯了
css應該相對於php 檔
而不是tpl 或html 檔!!!
切記
訂閱:
文章 (Atom)