-
-
-
method:open ( action, array_attribute, array_hidden );
return type:string
special:static
content:ใช้คืนค่า tag เปิดของ form แบบ post
example:$attributes = array ( "class" => "cssForm" );
$action = "control/method";
echo form::open ( $action, $attributes );
comment:ตัวแปร array_attribute ใช้กำหนด attribute โดย Key คือ attribute
และ value คือค่าของ attribute
ต้วแปร array_hidden ใช้กำหนด input ประเภท hidden โดย key คือ name
และ value คือ ค่าข้อมูล
-
method:open_multipart ( action, array_attribute, array_hidden );
return type:string
special:static
content:ใช้คืนค่า tag เปิดของ form แบบ post
และจะมีคำสั่ง enctype="multipart/form-data" มาด้วย
example:$action = "control/method";
echo form::open_multipart ( $action, $attributes );
comment:ตัวแปร array_attribute ใช้กำหนด attribute โดย Key คือ attribute
และ value คือค่าของ attribute
ต้วแปร array_hidden ใช้กำหนด input ประเภท hidden โดย key คือ name
และ value คือ ค่าข้อมูล
-
method:close ( html );
return type:string
special:static
content:ใช้คืนค่า tag ปิดของ form และจะมีคำสั่ง html ที่กำหนด ต่อท้าย tag ปิดของ form นี้ด้วย
example:echo form::close ( "<br/>" );
-
method:input ( name, value, attribute )
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท text
example:$attribute = " class='cssText' id='firstName' ";
echo form::input ( "first_name", "", $attribute );
-
method:input ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท text
example:$arr[ "name" ] = "first_name";
$arr[ "value" ] = "";
$arr[ "class" ] = "cssText";
$arr[ "id" ] = "firstName";
echo form::input ( $arr );
-
method:hidden ( name, value );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท hidden
example:echo form::hidden ( "parent_id", "2" );
-
method:hidden ( array_hidden );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท hidden
example:$hidden = array ( "id" => "1", "parent_id" => "2" );
echo form::hidden ( $hidden );
comment:ต้วแปร array_hidden ใช้กำหนด input ประเภท hidden โดย key คือ name
และ value คือ ค่าข้อมูล
-
method:password ( name, value, attribute );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท password
example:$attribute = " class='cssText' id='passWord' ";
echo form::password ( "password", "", $attribute );
-
method:password ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท password
example:$arr[ "name" ] = "password";
$arr[ "value" ] = "";
$arr[ "class" ] = "cssText";
$arr[ "id" ] = "passWord";
echo form::password ( $arr );
-
method:upload ( name, value, attribute )
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท file
example:$attribute = " class='cssText' id='logo' ";
echo form::upload ( "logo", "", $attribute );
-
method:upload ( array_attribute )
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท password
example:$arr[ "name" ] = "logo";
$arr[ "value" ] = "";
$arr[ "class" ] = "cssText";
$arr[ "id" ] = "logo";
echo form::upload ( $arr );
-
method:textarea ( name, value, attribute );
return type:string
special:static
content:ใช้คืนค่า tag textarea
example:$attribute = " class='cssText' id='description' ";
echo form::textarea ( "description", "", $attribute );
-
method:textarea ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag textarea
example:$arr[ "name" ] = "description";
$arr[ "value" ] = "";
$arr[ "class" ] = "cssText";
$arr[ "id" ] = "description";
echo form::textarea ( $arr );
-
method:dropdown ( name, array_option, array_selected, attribute );
return type:string
special:static
content:ใช้คืนค่า tag select
example:$options = array ( "1"=>"man", "2"=>"woman" );
$attribute = " class='cssSelect' id='sex' ";
echo form::dropdown ( "sex", $options, array ( "1" ), $attribute );
comment:ตัวแปร array_selected ถ้ากำหนด ข้อมูลที่ถูกเลือก เพียงตัวเดียว ก็จะเป็น dropdown
แต่ถ้ากำหนด ข้อมูลที่ถูกเลือก หลายตัว ก็จะเป็น list
-
method:checkbox ( name, value, checked, attribute );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท checkbox
example:$attribute = " class='cssCheckbox' id='favourite' ";
echo form::checkbox ( "favourite", "1", true, $attribute );
-
method:checkbox ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag textarea
example:$arr[ "name" ] = "favourite";
$arr[ "value" ] = "1";
$arr[ "class" ] = "cssCheckbox";
$arr[ "id" ] = "favourite";
echo form::checkbox ( $arr );
-
method:radio ( name, value, selected, attribute );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท radio
example:$attribute = " class='cssRadio' id='sex' ";
echo form::radio ( "sex", "1", true, $attribute );
-
method:radio ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท radio
example:$arr[ "name" ] = "sex";
$arr[ "value" ] = "1";
$arr[ "class" ] = "cssRadio";
$arr[ "id" ] = "sex";
echo form::radio ( $arr );
-
method:submit ( name, value, attribute )
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท submit
example:$attribute = " class='cssButton' id='submit' ";
echo form::submit ( "submit", "confirm", $attribute );
-
method:submit ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag input ประเภท submit
example:$arr[ "name" ] = "submit";
$arr[ "value" ] = "confirm";
$arr[ "class" ] = "cssButton";
$arr[ "id" ] = "submit";
echo form::submit ( $arr );
-
method:button ( name, value, attribute );
return type:string
special:static
content:ใช้คืนค่า tag button
example:$attribute = " class='cssButton' id='button' ";
echo form::button ( "button", "confirm", $attribute );
-
method:button ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag button
example:$arr[ "name" ] = "button";
$arr[ "value" ] = "confirm";
$arr[ "class" ] = "cssButton";
$arr[ "id" ] = "button";
echo form::button ( $arr );
-
method:label ( for, text, attribute );
return type:string
special:static
content:ใช้คืนค่า tag label
example:$attribute_text = " class='cssText' id='firstName' ";
echo form::input ( "first_name", "", $attribute_text );
$attribute_label = " class='cssLabel' id=label' ";
echo form::label ( "firstName", "First Name :", $attribute_label );
-
method:attributes ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า คำสั่งของ attribute
example:$attributes = array ( "class"=>"cssText", "id"=>"firstName" );
$attribute = form::attributes ( $attributes );
echo form::input ( "first_name", "", $attribute );
-
method:open_fieldset ( array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag เปิดของ fieldset
example:echo form::open_fieldset ();
-
method:close_fieldset ();
return type:string
special:static
content:ใช้คืนค่า tag ปิดของ fieldset
example:echo form::close_fieldset ();
-
method:legend ( text, array_attribute );
return type:string
special:static
content:ใช้คืนค่า tag legend
example:echo form::legend ( "ประวัติส่วนตัว" );