-
-
-
function:form_open ( action, attribute, hidden )
return type:string
content:ใช้สร้าง code ในส่วนของ tag เปิดของ form แบบ post ( มี attribute method="post" )
example:$attribute = array ( "id"=>"form", "class"=>"form" );
$hidden = array ( "parent_id"=>"0" );
echo form_open ( "product/save", $attribute, $hidden );
comment:ตัวแปร action ใช้กำหนด action ให้กับ form โดยเริ่มตั้งแต่ controller
ตัวแปร attribute ใช้กำหนด attribute โดย key คือ ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
ตัวแปร hidden ใช้สร้าง input ประเภท hidden โดย key คือค่าข้อมูลของแอททริบิวต์ name และ value คือค่าข้อมูลของแอททริบิวต์ value
-
function:form_close ( text )
return type:string
content:ใช้สร้าง code ในส่วนขงอ tag ปิดของ form
example:echo form_close ( );
comment:ตัวแปร text คือใช้กำหนดข้อความที่จะอยู่ต่อจาก tag ปิดของ form ซึ่งสามารถเป็นคำสั่ง html ก็ได้
-
function:form_fieldset ( legend, attribute )
return type:string
content:ใช้สร้าง code ในส่วนของ tag เปิดของ fieldset
example:$attribute = array ( "id"=>"addr_info", "class"=>"info" );
echo form_fieldset ( "Address Infomration", $attribute );
comment:ตัวแปร legend ใช้กำหนดข้อความที่อยู่ในส่วนของ tag legend
ตัวแปร attribute ใช้กำหนด attribute โดย key คือ ชื่อแอททริบิวต์
และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_fieldset_close ( text )
return type:string
content:ใช้สร้าง code ในส่วนของ tag ปิดของ fieldset
example:echo form_fieldset_close ( );
comment:ตัวแปร text คือใช้กำหนดข้อความที่จะอยู่ต่อจาก tag ปิดของ form
ซึ่งสามารถเป็นคำสั่ง html ก็ได้
-
function:form_hidden ( array_hidden )
return type:string
content:ใช้สร้าง input ประเภท hidden
example:$hidden = array ( "parent_id"=>"0" );
echo form_hidden ( $hidden );
comment:ตัวแปร array_hidden เป็นตัวแปร array โดย key คือค่าข้อมูลของ
แอททริบิวต์ name และ value คือค่าข้อมูลของแอททริบิวต์ value
-
function:form_hidden ( name, value )
return type:string
content:ใช้สร้าง input ประเภท hidden
example:echo form_hidden ( "parent_id", 0 );
-
function:form_input ( array_input )
return type:string
content:ใช้สร้าง input ประเภท text
example:$input = array ( "name"=>"name", "class"=>"text", "maxlength" => "20" );
echo form_input ( $input );
comment:ตัวแปร array_input เป็นตัวแปร array โดย key คือ ชื่อแอททริบิวต์
และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_input ( name, value, event )
return type:string
content:ใช้สร้าง input ประเภท text
example:echo form_input ( "name", "" );
-
function:form_password ( array_password )
return type:string
content:ใช้สร้าง input ประเภท password
example:$password = array ( "name"=>"password", "class"=>"text" );
echo form_input ( $password );
comment:ตัวแปร array_password เป็นตัวแปร array โดย key คือ
ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_password ( name, value, event )
return type:string
content:ใช้สร้าง input ประเภท password
example:echo form_password ( "password", "" );
-
function:form_upload ( array_upload )
return type:string
content:ใช้สร้าง input ประเภท file
example:$upload = array ( "name"=>"avatar", "class"=>"upload" );
echo form_upload ( $upload );
comment:ตัวแปร array_upload เป็นตัวแปร array โดย key คือ
ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_upload ( name, value, event )
return type:string
content:ใช้สร้าง input ประเภท file
example:echo form_upload ( "avatar", "" );
-
function:form_textarea ( array_textarea )
return type:string
content:ใช้สร้าง textarea
example:$textarea = array ( "name"=>"address", "cols"=>"50" );
echo form_textarea ( $textarea );
comment:ตัวแปร array_textarea เป็นตัวแปร array โดย key
คือ ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_textarea ( name, value, event )
return type:string
content:ใช้สร้าง textarea
example:echo form_textarea ( "address", "" );
-
function:form_checkbox ( array_checkbox )
return type:string
content:ใช้สร้าง input ประเภท checkbox
example:$checkbox = array ( "name"=>"favourite", "value"=>"0" );
echo form_checkbox ( $checkbox );
comment:ตัวแปร array_checkbox เป็นตัวแปร array โดย key
คือ ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_checkbox ( name, value, checked, event )
return type:string
content:ใช้สร้าง input ประเภท checkbox
example:echo form_checkbox ( "favourite", "0", true );
-
function:form_radio ( array_radio )
return type:string
content:ใช้สร้าง input ประเภท radio
example:$radio = array ( "name"=>"sex", "value"=>"0" );
echo form_radio ( $radio );
comment:ตัวแปร array_radio เป็นตัวแปร array โดย key คือ
ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_radio ( name, value, checked, event )
return type:string
content:ใช้สร้าง input ประเภท radio
example:echo form_radio ( "sex", "0", true );
-
function:form_dropdown ( name, array_option, selected )
return type:string
content:ใช้สร้าง select
example:$option = array ( "0"=>"small", "1"=>"medium", "2"=>"large", "3"=>"extra" );
echo form_dropdown ( "size", $option, "0" );
comment:ตัวแปร name ใช้กำหนด ค่าข้อมูลของ แอททริบิวต์ name ให้กับ select
ตัวแปร array_option ใช้กำหนด option โดย key คือค่าข้อมูลของ
แอททริบิวต์ name และ value คือค่าข้อมูลของแอททริบิวต์ value
ตัวแปร selected ช้กำหนดค่าของ value ของ option ที่ต้องการให้ถูกเลือกอยู่
-
function:form_submit ( array_submit )
return type:string
content:ใช้สร้าง input ประเภท submit
example:$submit = array ( "name"=>"submit", "value"=>"ยืนยัน", "class"=>"button" );
echo form_submit ( $submit );
comment:ตัวแปร array_submit เป็นตัวแปร array โดย key คือ
ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_submit ( name, value, event )
return type:string
content:ใช้สร้าง input ประเภท submit
example:echo form_submit ( "submit", "ยืนยัน" );
-
function:form_reset ( array_reset )
return type:string
content:ใช้สร้าง input ประเภท reset
example:ตัวแปร array_reset เป็นตัวแปร array โดย key คือ
ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_reset ( name, value, event )
return type:string
content:ใช้สร้าง input ประเภท reset
example:echo form_reset ( "reset", "ยกเลิก" );
-
function:form_button ( array_button )
return type:string
content:ใช้สร้าง input ประเภท button
example:$button = array ( "name"=>"button", "value"=>"ยืนยัน", "class"=>"button" );
echo form_button ( $button );
comment:ตัวแปร array_button เป็นตัวแปร array โดย key คือ
ชื่อแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ
-
function:form_button ( name, value, event )
return type:string
content:ใช้สร้าง input ประเภท button
example:echo form_button ( "button", "ยืนยัน" );
-
function:form_label ( text, for, attribute )
return type:string
content:ใช้สร้าง label
example:$attribute = array ( "style" => "color:red;" );
echo form_label ( "firstname : ", "firstname", $attribute );
comment:ตัวแปร text ใช้กำหนดข้อความภายใน tag label
ตัวแปร for ใช้กำหนดค่าข้อมูลในส่วนขงอ attribute for
ตัวแปร attribute ใช้กำหนดแอททริบิวต์ โดย key คือ
ชื่อของแอททริบิวต์ และ value คือค่าข้อมูลของแอททริบิวต์นั้นๆ