Welcome Guest, Not a member yet? Register   Sign In
HMVC + My_Controller and changed $this->load->_ci_view_path
#1

[eluser]Unknown[/eluser]
Hello i was trying to setup an HMVC on a clean ci 2.0.1.
Content of my files:

application/core/Admin_Controller.php


Code:
class  Admin_Controller  extends  CI_Controller  {

    function __construct ()  {
        parent::__construct();
    $this->load->_ci_view_path = "/home/fabio/public_html/fabio/ci201/views/";
        }
        function loadview($view){
            $this->load->view($view);
        }
    }




/home/fabio/public_html/fabio/ci201/views/welcome.php

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends Admin_Controller {
    public function index()
    {
        $this->loadview('welcome_message');
    }
}



NO other modified files. All is setup as described in https://bitbucket.org/wiredesignz/codeig.../wiki/Home ..

ALL works if i put welcome.php inside application/views ( as standard ) but i need to manage the variables $this->load->_ci_view_path and setup different views path from the MY_Controller ( for example Admin_controller that setup admin views path, Public_controller that setup public views path, all view path out of ci dir structure )


The problem:

Inside application/third_party/MX/Modules.php at line 195
Code:
if ($base == 'views/' OR $base == 'plugins/') {
if (is_file(APPPATH.$base.$path.$file_ext)) return array(APPPATH.$base.$path, $file);    
show_error("Unable to locate the file: {$path}{$file_ext}");
}
return array(FALSE, $file);


Module::find check if file APPPATH.$base.$path.$file_ext exists
but APPPATH is "application".
The $this->load->_ci_view_path as been ignored and gives then file not found error.



So, what i'm doing wrong ?

Fast fix: comment out show_error() and all works...

Bye


Messages In This Thread
HMVC + My_Controller and changed $this->load->_ci_view_path - by El Forum - 03-30-2011, 09:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB