Thule - 0.9.6
  • Welcome
  • Introduction
  • - MVC(Model-View-Controller)
    - Architecture of Framework
    - Flow Chart of Application
    - Services In One Server
    - Developing Guide
    - Features
  • Installation
  • Getting Started
  • - Direct Access HTTP
    - Router Access HTTP
    - Router Direct Access HTTP
    - Reserved Function
    - Convention
    - Bootstrap
    - Pack Javascript , CSS
  • Basic Modules
  • - Model
    - View
    - Controller
  • Libraries
  • - Router
    - Config
    - Response
    - Request
    - Database
    - Query
    - Cache
    - Debug
    - Log
    - Unit Test
    - Registry
    - Profile
  • Helper
  • - Auth
    - Calendar
    - Date
    - Error page
    - Email
    - Form
    - GeoIP
    - Google
    - Html Element
    - Html
    - Http
    - I18n
    - Image
    - Json
    - Jquery
    - Login
    - Layout
    - Locale
    - PHP to Javascript
    - Paging
    - Payflow
    - Soap
    - Text
    - Table
    - Uri
    - Upload
    - Validation
  • Plugins
  • - Smarty Template Engine
  • History
  • Home > Form

    Load Form Helper

    Form helper is sometimes very useful when you want to make the same format to somewhere.

    Even you can create the table into form which means you can design the html without "real-html-code" with array.

    $FE->loadHelper("form");
    echo $FE->Form->draw(form-array);

    Form Helper provides the functionality of build the form without html tag.

    Make the array form

    $form=array(
    array("input"=>array("type"=>"submit","value"=>"update")),
    }

    Make the attribute of array form

    you can put the attributes that you want.

    $form=array(
    array("input"=>array("id"=>"aaa","value"=>"fff")),
    array("div"=>array("id"=>"aaa","cdata"=>"div")),
    "id"=>"form","mehtod"=>"post","action"=>"url",
    }

    Make the array form

    $form=array(
    "table"=>$table, // you can put the table into the form.
    array("input"=>array("id"=>"aaa","value"=>"fff")),
    array("div"=>array("id"=>"aaa","cdata"=>"div")),
    array("span"=>array("id"=>"aaa","cdata"=>"span")),
    array("input"=>array("type"=>"hidden","value"=>"fff")),
    array("input"=>array("type"=>"radio","value"=>"fff")),
    array("input"=>array("type"=>"checkbox","value"=>"fff")),
    array("select"=>array(
    "id"=>"select",
    "options"=>array(
    array("value"=>1,"cdata"=>"nnnn"),
    array("value"=>2,"cdata"=>"aaaa"),
    array("value"=>3,"cdata"=>"cccc"),
    ),
    ),
    ),
    array("textarea"=>array("rows"=>2,"cols"=>20,"cdata"=>"aasdfasdfasfasdf")),
    array("input"=>array("type"=>"submit","value"=>"update")),
    "id"=>"form","mehtod"=>"post","action"=>"ddd",
    );

    Rendering form

    echo $FE->Form->draw(form-array);