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

Postingan populer dari blog ini

Mencari Data Double/Ganda pada Database SQL

Langsung saja, untuk mencari data double atau ganda pada database SQL yaitu dengan contoh sebagai berikut: SELECT NoPasien, COUNT(*) AS Jumlah FROM Pasien GROUP BY NoPasien HAVING (COUNT(NoPasien) > 1) Pada query di atas kita akan memilih kolom NoPasien dan menghitung jumlah data double/ganda dengan alias Jumlah. Lalu untuk memisahkan data yang double atau lebih dari satu kita menggunakan perintah: HAVING (COUNT(NoPasien) > 1)  Sudah begitu saja. Semoga bermanfaat.