Welcome Guest, Not a member yet? Register   Sign In
CI4 Beta 1: function _remap not works properly
#2

I'm having the same issue.

My approach is to "fool" it by placing a dummy function if I'm not messing with Route

Code:
public function parameter1()
{
    // placeholder
}

Anyone has a better idea?

(03-25-2019, 10:12 PM)hlmqz Wrote: my english is not the best.

in Codeigniter 3 I do:

URL:
/test/parameter1/parameter2/<parameterN>

CI3
called class: Test 
called method:  _remap (I have it function declared).

in Codeigniter 3 all works ok.

but in Codeigniter 4,

with URL:
/test
CI4 call method _remap, woks ok.

but with URL:
/test/parameter1
or URL 
/test/parameter1/parameter2/<parameterN>

show error: ReflectionException "Method App\Controllers\Test::parameter1() does not exist"

-----

Details:
- No setting route additional.
- I try wihtout function index, but it does not affect.

PHP Code:
<?php namespace App\Controllers;

use 
CodeIgniter\Controller;

class 
Test extends Controller
{
    public function 
index()
    {
        echo 
"Test/index";
    }
    
//--------------------------------------------------------------------
    
public function _remap($method)
    {
        echo 
"Test/remap - {$method}";
    }
    
//--------------------------------------------------------------------




excuse my english, I appreciate the help. thanks!!
Reply


Messages In This Thread
RE: CI4 Beta 1: function _remap not works properly - by juworld - 09-25-2019, 08:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB