//in you booking model
function create($data) {
if (empty($data['Booking']['country_id'])) {
$data['Booking']['country_id'] = 225;
}
parent::create($data);
}
this would preconfigure country_id value to 255
Update:
In order to have these data available in your view you must setup $this->data variable in your controller:
$this->data = $this->Booking->create();
you can also setup $this->data variable directly in your controller:
$this->data['Booking']['country_id'];
* if you are testing it with firefox be aware that the browser doesn't refresh your form data values until you press ctrl+f5
No hay comentarios:
Publicar un comentario