CI4 Controller and Route Migration Summary | Generated by AI

Home 2026.04

Pushed! Here’s the full session summary:


🦞 Routes Fix — What Was Done

Root cause: CI4 doesn’t use __construct() — it uses initController() for controller initialization.

What was fixed across all 24 controllers + 6 models:

Fix Detail
Routes defined All ~100 CI3 routes converted to CI4 $routes->get/post/match() format
__construct()initController() PHP 8.5 calls initController(), not __construct(). All child controllers converted.
Namespace ordering namespace must come before use statements in PHP
use AppModelsXxxApp\Models\Xxx Broken backslash-less use statements fixed
public public functionpublic function Duplicate modifiers removed
$this->load->library/model → removed CI3 loaders don’t exist in CI4 — direct new ClassName()
HTTP method suffixes stripped isRegister_get()isRegister() (explicit routing, no REST suffixes)
Missing use for libraries/models Controllers now import all App\Libraries\* and App\Models\* classes they use
update() signature conflict LiveDao, AttendanceDao, WechatGroupDao — renamed to updateRow() (PHP 8 incompatible with Model::update())
448 constants added All CI3 ERROR_*, KEY_*, CHANNEL_*, TRANS_TYPE_* constants now in app/Config/Constants.php
QiniuLive.php created CI4 version of missing streaming library

Result: 11 routes tested — all HTTP 200. 🎉


Back Donate