Welcome Guest, Not a member yet? Register   Sign In
Custom view method
#1

In CI3, I created a custom view method (cView) by extending CI_Loader :


Quote:// My controller, log user data and search queries
class MY_Loader extends CI_Loader
{
    public function __construct()
    {
        parent::__construct();
    }
   
    // Custom view loader, load and return the view if display is true
    public function cView($view, $vars = array(), $display = TRUE)
    {
        if (!$display) return '';
        return $this->view($view, $vars, TRUE);
    }
}



Since CI_Loader and the core folder no longer exist, I can't figure out where I should create my custom cView function in CI4? The main constrain is that cView() calls the native view() method.
Reply


Messages In This Thread
Custom view method - by imabot - 05-06-2020, 10:38 AM
RE: Custom view method - by jreklund - 05-06-2020, 11:33 AM
RE: Custom view method - by imabot - 05-07-2020, 09:19 PM
RE: Custom view method - by jreklund - 05-08-2020, 09:37 AM
RE: Custom view method - by imabot - 05-09-2020, 10:52 PM



Theme © iAndrew 2016 - Forum software by © MyBB