Модель:
Код: Выделить всё
function get_subsection($sec_id,$subsec_name){
$this->db->selec("*");
$this->db->where('sec_id',$sec_id);
$this->db->where('subsec_name !=',$subsec_name);
$query=$this->db->get('sub_section');
if($query->num_rows() > 0)
{
return $query;
}
else
return false;
}
Контроллер
Код: Выделить всё
function edit($id){
$data['rec']=$this->amodel->edit_art($id);//get the record to update
foreach($data['rec'] as $a)
{
$sections['items']=$this->amodel->section('$a->sec_id');//select all sections without that which selected by user
$subsetion['sub']=$this->amodel->subsection($a->sec_id,$a->subsec_name);//select all subsections of a section which selected by user
}
$this->load->view('edit_art',array_merge($data,$sections,$subsection));
}
пожалуйста, подскажите мне, что мне делать, чтобы отобразить все элементы формы, даже если подраздел будет пустым.
Подробнее здесь: https://stackoverflow.com/questions/233 ... el-in-view
Мобильная версия