-
-
-
method:specialchars ( text, boolean );
return type:string
special:static
content:ใช้ encode ตัวอักขระพิเศษต่างๆ เช่น "<", "/", ">", "\"
ให้เป็นรูปแบบ html เช่น "<", ">"
example:echo html::specialchars ( "<br/>" );
-
method:anchor ( href, title, array_attribute, protocol );
return type:string
special:static
content:ใช้คืนค่า tag a
example:$attributes = array ( "class"=>"cssAnchor", "id"=>"linkHome" );
echo html::anchor ( "control/method", "link", $attributes );
comment:ตัวแปร array_attribute ใช้กำหนด attribute โดย Key คือ attribute
และ value คือค่าของ attribute
ตัวแปร protocol ใช้ในการกำหนด protocol ของ link โดยมีค่า default คือ "http"
-
method:file_anchor ( href, title, array_attribute, protocol );
return type:string
special:static
content:ใช้คืนค่า tag a โดยจะใช้ในกรณีที่ link ไปยังไฟล์ต่างๆ เช่น pdf, doc, txt เป็นต้น
example:$attributes = array ( "class"=>"cssAnchor", "id"=>"linkFile" );
echo html::file_anchor ( "folder/filename.pdf", "link", $attributes );
comment:ตัวแปร array_attribute ใช้กำหนด attribute โดย Key คือ attribute
และ value คือค่าของ attribute
ตัวแปร protocol ใช้ในการกำหนด protocol ของ link โดยมีค่า default คือ "http"
-
method:panchor ( protocol, href, title, array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag a โดยนิยมใช้ในกรณีที่ protocol ไม่ใช่ http
example:$attributes = array ( "class"=>"cssAnchor", "id"=>"linkFTP" );
echo html::panchor ( "ftp", "images", "link ftp", $attributes );
comment:ตัวแปร protocol ใช้ในการกำหนด protocol ของ link โดยมีค่า default คือ "http"
ตัวแปร array_attribute ใช้กำหนด attribute โดย Key คือ attribute
และ value คือค่าของ attribute
-
method:anchor_array ( array_anchor );
return type:array
special:static
content:ใช้คืนค่า tag a แบบ array
example:$anchors = array ( "control/method"=>"one", "control/method_two"=>"two" );
echo html::anchor_array ( $anchors );
comment:ตัวแปร array_anchor มี key คือ href และ value คือข้อความที่แสดงบนลิงค์ ( title )
-
method:email ( email );
return type:string
special:static
content:เป็นการ encode ข้อความ email ( เมื่อดูจาก source code )
เพื่อปกป้องจาก spam และ email havesting
example:echo html::email ( "bamboolabcode@gmail.com" );
-
method:mailto ( email, title, array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag a ที่เป็นการ link เพื่อการส่ง email ไปยัง email ที่กำหนด
โดยจะมีการ encode ข้อความ email ( เมื่อดูจาก source code ) ให้ด้วย
เพื่อปกป้องจาก spam และ email havesting
example:$email = "bamboolabcode@gmail.com";
echo html::mailto ( $email, "bamboolabcode" );
comment:ตัวแปร array_attribute ใช้กำหนด attribute โดย Key คือ attribute
และ value คือค่าของ attribute
-
method:meta ( name, content );
return type:string
special:static
content:ใช้คืนค่า tag meta
example:echo html::meta ( "keywords", "framework, kohana, php, function" );
echo html::meta ( "description", "E-Learning abount framework programming." );
-
method:meta ( array_meta );
return type:string
special:static
content:ใช้คืนค่า tag meta
example:$metas = array ( "keywords"=>"framework, kohana, php, function",
"description"=>"E-Learning abount framework programming." );
echo html::meta ( $metas );
comment:ตัวแปร array_meta ใช้กำหนด attribute โดย Key คือ name
และ value คือค่าของ content
-
method:stylesheet ( href, media, absolute );
return type:string
special:static
content:ใช้คืนค่า tag link ที่เป็น stylesheet
example:echo html::stylesheet ( "media/main.css", "screen" );
comment:ตัวแปร absolute ถ้ากำหนด true จะหมายถึงอ้างอิงแบบ absolute path
-
method:link ( href, rel, type, boolean, media, absolute );
return type:string
special:static
content:ใช้คืนค่า tag link
example:$href = "media/main.css";
$rel = "StyleSheet";
$type = "text/css";
echo html::link ( $href, $rel, $type );
comment:ตัวแปร absolute ถ้ากำหนด true จะหมายถึงอ้างอิงแบบ absolute path
-
method:script ( src, absolute );
return type:string
special:static
content:ใช้คืนค่า tag script
example:$src = "media/script/library.js";
echo html::script ( $src );
comment:ตัวแปร absolute ถ้ากำหนด true จะหมายถึงอ้างอิงแบบ absolute path
-
method:image ( src, array_attribute, absolute );
return type:string
special:static
content:ใช้คืนค่า tag img
example:$attributes = array ( "class"=>"cssImage" );
$src = "media/imgaes/logo.png";
echo html::image ( $src, $attributes );
comment:ตัวแปร array_attribute ใช้กำหนด attribute โดย Key คือ attribute
และ value คือค่าของ attribute
ตัวแปร absolute ถ้ากำหนด true จะหมายถึงอ้างอิงแบบ absolute path
-
method:attributes ( array_attribute )
return type:string
special:static
content:ใช้คืนค่า คำสั่งของ attribute
example:$attributes = array ( "class"=>"cssText", "id"=>"firstName" );
echo html::attributes ( $attributes );