| anchor() | ใช้สร้าง code ที่เป็น tag a |
|---|---|
| redirect() | ใช้เปลี่ยนหน้า web page ไปยัง page ที่กำหนด |
function:anchor ( href, text, attribute )
return type:string
content:ใช้สร้าง code ที่เป็น tag a
example:$attribute = array ( "id"=>"anchor", "class"=>"anchor" ); echo anchor ( "product/form", "create", $attribute );
comment:ตัวแปร href ใช้กำหนด path ที่ต้องการ link ไป ตัวแปร text ใช้กำหนด ข้อความที่ต้องการให้เป็น link ตัวแปร attribute ใช้กำหนด attribute โดย key คือ ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
function:redirect ( url, method, http_code )
return type:void
content:ใช้เปลี่ยนหน้า web page ไปยัง page ที่กำหนด
example:redirect ( "produce/data" );
comment:ตัวแปร url ใช้กำหนด path ที่ต้องการให้เปลี่ยน page ไป ตัวแปร method ใช้กำหนดวิธีการเปลี่ยนหน้า web page คือ refresh หรือ location ตัวแปร http_code ใช้กำหนด HTTP Response Code แต่ต้อง กำหนด method = location เท่านั้น