For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Saturday, October 05, 2013

Remove Controller and it's method form codeigniter

How to remove Controller in  codeigniter and it's method just show it's parameter in url for ex:


http://localhost:90/CodeIgniter_2.1.4_new/category/show/this-is-the-test.html
as
http://localhost:90/CodeIgniter_2.1.4_new/this-is-the-test.html

Goto routes.php under config directory:
write this listed below line
$route['(:any)'] = "category/show/$1";
==============================
====================================================
create a new file "category.php"
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Category extends CI_Controller {
    public function index() {
        $this->load->view('welcome_message');
    }
    public function show($text) {
            echo "aaaaa".$text;  
    }
}
Share:

0 comments:

Post a Comment

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights

Unable to resolve <website url> Try checking the for validity Google Pagespeed Insights   You have a website and want to test it'...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive