public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'vouchers' => array(self::MANY_MANY, 'Vouchers', 'restaurant_voucher(rid, vid)'),
);
}
I edited /views/restaurants/_form.php and added this code
variable $model->vouchers contains all vouchers which belong to a particular restaurant. However, a page /restaurants/update/1 returns a php error ‘Property “Restaurants.vid” is not defined.’.
It makes sence. Restaurants has no vid. How can I create checkboxes using activeCheckBoxList?
I would like display a restaurant with all vouchers which are stored in the table vouchers. Each voucher should be displayed with a label and should be check/unched according to table restaurant_voucher.