Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter v4.3.8 and v4.4.0 Released!

(This post was last modified: 09-07-2023, 07:12 AM by chaos.)

(09-07-2023, 01:53 AM)kenjis Wrote: I cannot reproduce the error.
I see "<a href="http://localhost:8080/index.php/battle/view/4">here</a>".

PHP Code:

namespace App\Controllers;

Home extends BaseController
    public function index(): string
        return model('Foo')->replicateBug();

PHP Code:

namespace App\Models;


Foo extends Model
    protected $table 'foo';

    public function replicateBug(): string
        return anchor('battle/view/4''here');

Note: I checked and I did not extend or replace/customize the URI or Request Service.

Did you try to reproduce it by calling the method from CLI?

I added a debug message and if i browse the app the uri returned is correct: $currentURI CodeIgniter\HTTP\SiteURI#21 (20)

While if i call the method in the Model from CLI and i type from ms-dos: 

>php public\index.php battle replicate_bug

I have wrong URI: 

PHP Code:
CodeIgniter\HTTP\URI#19 (15) (
    protected 'uriString' -> null
private 'baseURL' -> null
protected 'segments' -> array (0) []
    protected 'scheme' -> string (4"http"
    protected 'user' -> null
protected 'password' -> null
protected 'host' -> null
protected 'port' -> null
protected 'path' -> null
protected 'fragment' -> string (0""
    protected 'query' -> array (0) []
    protected 'defaultPorts' -> array (4) [
        'http' => integer 80
'https' => integer 443
'ftp' => integer 21
'sftp' => integer 22
    protected 'showPassword' -> boolean false
protected 'silent' -> boolean false
protected 'rawQueryString' -> boolean false


Messages In This Thread
RE: CodeIgniter v4.3.8 and v4.4.0 Released! - by chaos - 09-07-2023, 07:11 AM

Theme © iAndrew 2016 - Forum software by © MyBB