public function action_index() { View::set('custom_fields', CustomField::select()->where('project_id', $this->project->id)->exec()->fetch_all()); }
/** * Delete field. */ public function destroyAction($id) { $field = CustomField::select()->where('id = ?')->andWhere('project_id = ?')->setParameter(0, $id)->setParameter(1, $this->currentProject['id'])->fetch(); $field->delete(); return $this->respondTo(function ($format) use($field) { if ($format == "html") { return $this->redirectTo('project_settings_custom_fields'); } elseif ($format == "json") { return $this->jsonResponse(['deleted' => true, 'field' => $field->toArray()]); } }); }