CodeIgniterでURL情報を取得する便利メソッド
$this->router->fetch_method();
$this->router->fetch_class();
CodeIgniterの開発で以下のようなURLのページにアクセスした場合
http://hogeho.com/main/top
mainクラスの中のtopメソッドにアクセスしていることになる。
echo $this->router->fetch_class();
#結果: main
echo $this->router->fetch_method();
#結果: top