/** * @return array[] */ public function componentSelectOptions() { $options = []; $components = Component::where('project_id = ?')->setParameter(0, $this->id)->orderBy('name', 'ASC'); foreach ($components->execute()->fetchAll() as $component) { $options[] = ['label' => $component['name'], 'value' => $component['id']]; } return $options; }
function update() { $this->filter_access('Component', 'roled_edit', 'components/index'); $component = new Component(); $component->where('comp_id', $this->input->post('id'))->update(array('comp_name' => $this->input->post('comp_name'), 'comp_type' => $this->input->post('comp_type'))); $this->session->set_flashdata('message', 'Component Update successfuly.'); redirect('components/'); }