0

What is GoBaseController and why does CI Wiz use it?

The generated code references GoBaseController everywhere. What is it, what does it provide, and should I extend it in my own custom controllers?
Posee par Inconnu Jan 27, 2026 100 vues

1 reponse

0
✓ Acceptee
`GoBaseController` is an abstract controller class that CI Wiz generates once per project. All generated controllers extend it rather than extending CI4's `BaseController` directly. It centralizes logic that would otherwise be copy-pasted into every controller: shared `$viewData` initialization, common validation helpers, the `displayForm()` method (which may be deprecated in a future release), and utility wrappers around session and response handling. You can and should extend it for your own custom controllers too — it gives you the same baseline as the generated ones. If CI Wiz regenerates `GoBaseController.php`, any modifications you made to it would be overwritten, so keep your customizations in subclasses rather than editing the base directly.
Repondu par cantonner Jan 27, 2026

Veuillez vous connecter pour publier une reponse. vous connecter