CodeIgniter Forums
Request for Help: CodeIgniter 3 to 4 Migration - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Request for Help: CodeIgniter 3 to 4 Migration (/showthread.php?tid=92696)



Request for Help: CodeIgniter 3 to 4 Migration - ckiyan - 03-31-2025

I'm currently working on migrating a website from CodeIgniter 3 to CodeIgniter 4 and facing several challenges. I have very limited experience with this framework and have been using AI tools to assist me.
Current Situation:
  • The website is organized into Frontend and Backend sections
  • I've already migrated CSS, JS, and images to the public directory
  • The homepage has animations that aren't loading properly (likely JavaScript-related)
  • Some pages don't follow the standard MVC (Model-View-Controller) structure
Specific Issues:
  1. I'm unsure if I've correctly placed all CSS and JavaScript files
  2. Pages without the standard MVC structure aren't working
  3. Homepage animations are broken
I would greatly appreciate any guidance on:
  • Properly organizing assets in CodeIgniter 4
  • Handling pages that don't follow the standard MVC pattern
  • Troubleshooting the JavaScript animation issues
Thank you in advance for any assistance you can provide!
the structure


RE: Request for Help: CodeIgniter 3 to 4 Migration - InsiteFX - 03-31-2025

Open and check your css files img to see if it is using a link, you may need to change it.

For assets we use them like this, this is most standard for CI.
Code:
// Assets

ROOT:
-- app
-- system
-- Public
---- assets
------ css
------ js
------ images
------ img
------ icons
------ etc;



RE: Request for Help: CodeIgniter 3 to 4 Migration - ckiyan - 04-05-2025

I have tried to migrate to Codeigniter v4.
The following options at the menu are working
https://niph.org.kh/niph2025/laboratory
https://niph.org.kh/niph2025/niph-school

But I can't find out why these are not 
https://niph.org.kh/niph2025/research
https://niph.org.kh/niph2025/library
This is the original website https://niph.org.kh/niph/
I tried not to change the classes and the structure to make the migration easier
they should look like this  https://niph.org.kh/niph/home/index.html
Thanks in advance


RE: Request for Help: CodeIgniter 3 to 4 Migration - InsiteFX - 04-05-2025

The following return types are supported

int
float
bool
string
array
callable
interfaces
object (PHP 7.2+)

You can also declare a nullable return type by putting a question mark in front of the return data type.

PHP Code:
public function foo(): ?int {
    // ...
    return bar;