0

I want to set my checked box to be checked if

$this->Acl->check($group, 'controllers/'.$selectedController.'/'.$act);

is returning 1. Or if the checkbox is checked before as its value is saved in acos_aros table. I want to do that in the view but don't know how. Any help?

Thanks

Nick Cox
  • 35,529
  • 6
  • 31
  • 47

1 Answers1

0

Condition 1

$condition1 = $this->Acl->check($group, 'controllers/'.$selectedController.'/'.$act) === 1;

Condition 2

$condition2 = [some other logic here];

Checkbox

<input type='checkbox' <?php if($condition1 || $condition2) echo "checked" ?>>
Matt Harrison
  • 13,381
  • 6
  • 48
  • 66