|
 |
|
เกี่ยวกับไฟล์ อยากถามว่าภ้าเราเก็บไฟล์ไว้หลายๆ Folder ต้องการเรียกแต่มันจำที่อยู่ไม่ได้ มีวิธีที่จะให้มันจำไหมค่ะ |
|
 |
|
|
 |
 |
|
ในไฟล์ menu เปลี่ยนไปใช้ absolute path แทนครับ
<?php
//include/menu.php
define('ROOT',str_replace("\\",'/',dirname(dirname(__FILE__))));
define('PATH', ROOT == $_SERVER['DOCUMENT_ROOT']
?'' :substr(ROOT,strlen($_SERVER['DOCUMENT_ROOT']))
);
?>
<a href="<?php echo PATH,'/index.php';?>"><?php echo PATH,'/index.php';?></a>
<a href="<?php echo PATH,'/login.php';?>"><?php echo PATH,'/login.php';?></a>
<a href="<?php echo PATH,'/product.php';?>"><?php echo PATH,'/product.php';?></a>
include-file-using-absolute-path
|
 |
 |
 |
 |
Date :
2009-10-01 00:21:42 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
php framework ที่ผมเขียนขึ้นใช้เอง แก้ปัญหา path และช่วยในการ reuse program ครับ
# ใช้ ADODB Class และ Smarty 3.0 Class เป็นคลาสหลักของโปรแกรม
# รูปแบบการเขียนแบบ CV Design Pattern
# แบ่งส่วนการแสดงผลเป็น layout และ view ช่วยการปรับเปลี่ยน layout ได้ง่าย
# ระยะเวลาการเขียนรู้ framework ต่ำมากโครงสร้าง folder อิสระเหมือนเขียนเว็บตามปกติ และ preview file ได้ทันทีใน text editor ส่วนใหญ่
# ความสามารถในการรวม folder ต่างระดับชั้นนำมาใช้ร่วมกัน โดยการปรับเปลี่ยนลิงค์ relative path ในไฟล์ template เป็น absolute path ทำให้สามารถ ดึงข้อมูล view ต่างๆ มารวมกันไว้ใน file เดียวแม้อยู่ในคนละ folder ได้โดยไม่ต้องแก้ไข view เก่าเลย
# ปิดการต่อ database ให้โดยอัตโนม้ติ
# ไฟล์ template สามารถแก้ไขใน wysiwyg editor อย่างเช่น dreamweaver ได้
http://www.ziddu.com/download/7950748/webdesigner0.9a.zip.html
|
 |
 |
 |
 |
Date :
2010-01-04 19:09:02 |
By :
num |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|