checkboxTag

Navigation:  Development > Function Reference > Helpers > Html >

checkboxTag

Previous pageReturn to chapter overviewNext page

Create a Checkbox Tag.
 
App::Html()->checkboxTag(Name, Data Array, Selected, Html Options);

 

Parameter

Description

Name

Name of the Input element

Data Array

List of element to create options group

Selected

Default selected value

Options

HTML Attributes

 

See bellow example:

 

echo App::Html()
    ->checkboxTag(
        "data[Player][choice]",
        array("I"=>"In Door Game","O"=>"Out Door Game"),
        "I",
        array(
            "id"=>"choice"
        )
    );
 
/* 
Return value 
<input  name="data[Player][choice]" type="checkbox" id="choice" checked="checked" value="I"  id="choice"  />

<label for="choice">In Door Game</label>

 

<input  name="data[Player][choice]" type="checkbox" id="choice_1" value="O"  id="choice"  />

<label for="choice_1">Out Door Game</label> 
*/