Untuk mendapatkan nama controller / method menggunakan framework codeigniter, gunakan perintah $this->router->fetch_class() dan $this->router->fetch_method().
http://localhost/index.php/controller/method
Contoh Penggunaan :
http://localhost/index.php/controller/method
Contoh Penggunaan :
class Someclass extends CI_Controller {
function index(){
echo $this->router->fetch_class(); // will output the current controller
echo "<br>";
echo $this->router->fetch_method(); // will output the current method
}
}
1 One Comment " Mendapatkan Nama Controller / Method menggunakan CodeIgniter "
php training in chandigarh
Awesome and very appreciating blog
Thanks for sharing
It really helped me alot
Post a Comment