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

Hi Here,

I thought about that, but the error I'm getting is not the 404, but the one shared by the original author of this post.

Let me simplify my example to make it more straight forward.

Code:
<?php namespace App\Controllers;

class Home extends BaseController
{
    public function index()
    {
        return view('welcome_message');
    }

    public function go_back()
    {
        echo "gone home";
    }
   
    public function _remap($methodName, ...$params)
    {
        return $this->go_back(...$params);
    }

    //--------------------------------------------------------------------
}

And I tried to access a method that is not there, i.e. /home/go. The _remap should kick in and call $this->go_back()

But, that's not happening...
Reply


Messages In This Thread
RE: CI4 Beta 1: function _remap not works properly - by juworld - 09-25-2019, 06:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB