otModel = model(OrdenTrabajoModel::class); parent::initController($request, $response, $logger); } public function index() { // Breadcrumbs $this->viewData['breadcrumb'] = [ ['title' => lang("App.orden_trabajo"), 'route' => "javascript:void(0);", 'active' => false], ['title' => "Table", 'route' => site_url('produccion/ordentrabajo'), 'active' => true] ]; return view(static::$viewPath . $this->indexRoute, $this->viewData); } public function delete() { } public function add() { } public function edit($orden_trabajo_id) { // Breadcrumbs $this->viewData['breadcrumb'] = [ ['title' => lang("App.orden_trabajo"), 'route' => "javascript:void(0);", 'active' => false], ['title' => "Table", 'route' => site_url('produccion/ordentrabajo'), 'active' => true] ]; return view(static::$viewPath . $this->editRoute, $this->viewData); } public function datatable(){ $q = $this->otModel->getDatatableQuery(); // return $this->response->setJSON($q->get()->getResultArray()); return DataTable::of($q) ->add("action" ,fn($q) => $q->id) ->toJson(true); } }