Very beginner here, please go easy :)
In our database we have a tinyint
field secondary_phone_number
which is either 0
or 1
value. We use the flourish MVC
.
0 = False, 1 = True.
I am trying to display a checkbox that indicates if the secondary_phone_number
is true with the following code:
if ($company->setSecondaryPhoneNumber(fRequest::get("secondary_phone_number")) == TRUE)
{
$company->setSecondaryPhoneNumber == TRUE;
} else {
$company->setSecondaryPhoneNumber == FALSE;
}
Then, displaying it with:
$data['secondaryphonenumber'] = $company->getSecondaryPhoneNumber();
And finally, rendering it in the .tpl with:
<h5>Enable Secondary phone numbers?</h5>
<label>
<input type="checkbox" name="secondary_phone_number" value="0" {{^secondaryphonenumber}}checked="checked"{{/secondaryphonenumber}}/>
Yes
</label><br>
Problem is, it's always displaying as Checked....even when the values are 0 in the DB... any help for this newb???!!