Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 4 Running Problem
#1

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');

use App\Controllers\Pages;
$routes->get("/home", [ Pages::class, "index" ]);


Pages.php
Quote:<?php

namespace App\Controllers;

use CodeIgniter\Exceptions\PageNotFoundException;


class Pages extends BaseController
{
  public function index()
  {
    return view("pages/home");
  }
}


home.php
Quote:<h1>Welcome</h1>


Looking forward to resolving the issue.

Awaiting a reply ASAP.


Thanks.
Reply


Messages In This Thread
CodeIgniter 4 Running Problem - by amitl - 09-12-2023, 06:58 AM
RE: CodeIgniter 4 Running Problem - by ozornick - 09-12-2023, 08:10 AM
RE: CodeIgniter 4 Running Problem - by kenjis - 09-12-2023, 09:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB