Langsung ke konten utama

Codeigniter 3.1.11 HMVC

 Edit file application/third_party/MX/Router.php

public function set_class($class)
{
$suffix = $this->config->item('controller_suffix');
if (strpos($class, $suffix) === FALSE)
{
$class .= $suffix;
}
parent::set_class($class);
}
 
menjadi:
 
public function set_class($class)
{
$suffix = $this->config->item('controller_suffix');
if( $suffix && strpos($class, $suffix) === FALSE) //kode perubahan yang benar
{
$class .= $suffix;
}
parent::set_class($class);
}
 
Dan file application/third_party/MX/Loader.php
 
public function view($view, $vars = array(), $return = FALSE)
{
list($path, $_view) = Modules::find($view, $this->_module, 'views/');
 
if ($path != FALSE)
{
$this->_ci_view_paths = array($path => TRUE) + $this->_ci_view_paths;
$view = $_view;
}
 
return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
}
 
menjadi:
 
public function view($view, $vars = array(), $return = FALSE)
{
list($path, $_view) = Modules::find($view, $this->_module, 'views/');
 
if ($path != FALSE)
{
$this->_ci_view_paths = array($path => TRUE) + $this->_ci_view_paths;
$view = $_view;
}
 
if (method_exists($this, '_ci_object_to_array'))
{
return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));
} else {
return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_prepare_view_vars($vars), '_ci_return' => $return));
}
}
 
Extension modular:  Download
 
 
 

Komentar