CodeIgniter 4 Running Problem |
Hi.
I am new to CodeIgniter 4. I am facing a few problems. Please help to resolve these. Environment: WAMP Server PHP 8.1 Installation: I am trying to install using Composer. But unable to get version 4.3 but get 4.19. Is there any possibility of using install 4.3? Problem: I am following the example documentation of static pages, but receive the below error. class_exists() expects parameter 1 to be string, array given Here is the code. Routes.php Quote:$routes->get('/', 'Home::index'); Pages.php Quote:<?php home.php Quote:<h1>Welcome</h1> Looking forward to resolving the issue. Awaiting a reply ASAP. Thanks.
Run
Code: composer require codeigniter4/framework:4.3.8
Simple CI 4 project for beginners codeigniter-expenses
difficult to see what your doing and not doing .
So just to clarify routes are in app/Config/Routes.php when you get /install codeigniter in routes you see : Code: $routes->setDefaultNamespace('App\Controllers'); so some default stuff set up for my home page I have in routes : Code: $routes->get('/home','Home::landingpage'); Then to get rid of the welcome to CI4 i made a Home.php controller containing Code: <?php you can edit Routes to use another function of your own controller eg Code: $routes->get('/', 'Home::index'); then for instance : Code: public function index() So now domain.com/ or domain.com/home willn ow go to the same landing page But i guess an edit of default routes might be needed explantion a bit mangled as i'm in a rush to g oto Aikido , so any questions just come back (09-12-2023, 06:58 AM)amitl Wrote: I am trying to install using Composer. But unable to get version 4.3 but get 4.19. Use PHP 7.4 or later. It is better to use PHP 8.1 or later. The end of life date for PHP 7.4 was November 28, 2022. If you are still using PHP 7.4, you should upgrade immediately. The end of life date for PHP 8.0 will be November 26, 2023. |
Welcome Guest, Not a member yet? Register Sign In |