modelTag

Navigation:  Development > Function Reference > Helpers > Html >

modelTag

Previous pageReturn to chapter overviewNext page

Fetch data from a Mode (Database Table) and crate a tag.

 

App::Html()->modelTag(Name,Model, [Default Value],[Parameter],[Option]);

 

Parameter

Description

Name

Name of the Input element

Model

Database Model name

Default Value

Default Value of the tag

Parameter

Define Input Type, SQL Condition, Key Value and Element title of of element.

 
inputType : Used to define input tag. checkboxTag, selectTag and radioTag is supporated.
condition : Sql conditon. By default fetch all entry.
key: Field name to use as key value. By Default set to id

val: Field name used as a label of input file. By Default set to id

Options

Html attributes

 

See bellow example:
 

echo App::Html()
    ->modelTag(
      "date[Member][id]",
      "Member",
      "",
      array(
          "condition" => "email like '%f%'"// By default fetch all
          "inputType"=>"radioTag"// By default set selectTag
          "key" =>"id"// By default set id
          "val"=>"email"
      ),
      array("class"=>"app_input")
  );