diff src/Generator/Controller/stubs/controller.stub @ 32:45f384a24553 codex

Support for server side tables
author Luka Sitas <sitas.luka.97@gmail.com>
date Tue, 19 Aug 2025 22:15:50 -0400
parents 010ace248d14
children
line wrap: on
line diff
--- a/src/Generator/Controller/stubs/controller.stub	Tue Aug 19 20:34:53 2025 -0400
+++ b/src/Generator/Controller/stubs/controller.stub	Tue Aug 19 22:15:50 2025 -0400
@@ -24,6 +24,15 @@
         return view('{{ tableName }}.index', $data);
     }
 
+    public function get_data()
+    {
+        $data = [];
+        $data['records'] = {{ model }}::get_data([]);
+        $data['total_records'] = count($data['records']);
+
+        return $data;
+    }
+
     /**
      * Show the form for creating a new resource.
      *