如何使用PHP codeigniter实现关键字特定的页面调用

How to implement keyword specific page invocation using PHP codeigniter

Binary search Tree Implementation.

for e.g. in above URL keyword "binary-search-tree-implementaion" is method name or parameter for specific controller. because most of things are dynamic then how web site is going to manage all those things?

I want to implement it for my web site like this

http://example.com/search/digital-camera-price-in-india

I'm not familiar with CodeIgniter, but usually a URI structure like /search/digital-camera-price-in-india would route to the Search controller and digitalCameraPriceInIndia action.

/search/digital-camera-price-in-india

=> SearchController::digitalCameraPriceInIndiaAction()

If you want to route similar URIs (different products for example) to a catch-all method, you've have to setup custom routing.

The CodeIgniter documentation for routing is here

As per @chriso's answer you will need to set up a custom route to achieve this as by default the uri structure is /controller/action/params. So in your config/routes.php file you can add something like:

$route['search/(:any)'] = "search/some_action";

And then use the relevant uri segment (

$this->uri->segment[1]

I think) as your search parameter.

if you set up your route like this:

$route['^search/(:any)'] = "search/my_controller_function/$1";

Then you can just write your function like this:

public function my_controller_function($search_input) 
{
 // your code here
}