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

Codeigniter HMVC PHP 7

  Perbaiki Error Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior Cara Memperbaikinya adalah sebagai berikut : buka folder application/third_party/MX/Router.php Berikutnya cari code function set_class , anda bisa menggunakan fasilitas pencarian di text editor yang anda gunakan, dengan menekan tombol CTRL + F, jika sudah ketemu, silahkan ubah codenya seperti dibawah ini code sebelumnya : public function set_class($class) { $suffix = $this->config->item('controller_suffix'); if (strpos($class, $suffix) === FALSE) { $class .= $suffix; } parent::set_class($class); } 1 2 3 4 5 6 7 8 9 public function set_class ( $ class ) { $ suffix = $ this -> config -> item ( 'controller_suffix' ) ; if ( strpos ( $ class , $ suffix ) === FALSE ) { $ class . = $ suffix ; } parent :: set_...

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.