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;
}
}
http://localhost:90/
as
http://localhost:90/
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_
}
public function show($text) {
echo "aaaaa".$text;
}
}
0 comments:
Post a Comment