Create dynamic SEO based url without function/controller name |
[eluser]Was[/eluser]
Hello friend, i want to create url something like http://www.mysitename.com/my-dynamic-title so how sholud we can create this instead of creating the URL http://www.mysitename.com/function-name/...amic-title .some one guide me how to do this in codeigniter. thanks Was
[eluser]Aken[/eluser]
Seriously, do some of you people not even TRY to learn these things on your own first? http://ellislab.com/codeigniter/user-gui...uting.html
[eluser]xeroblast[/eluser]
change route to to accept any : $route['(:any)'] = 'controller_name/function_name'; in your controller, class controller_name extends CI { function_name($var) { //process the $var string here; } }
[eluser]Was[/eluser]
Hello xeroblast, i have done changes as per your suggestion in routes.php and created the controller with the same code for now but i m getting the following error when executing the code by passing my title in url like http://www.mysitename.com/my-dynamic-title A PHP Error was encountered Severity: Warning Message: Missing argument 1 for controller_name::function_name() Filename: controllers/controller_name.php Line Number: 4 Thanks Was
[eluser]xeroblast[/eluser]
sorry about that : $route['(:any)'] = 'controller_name/function_name/$1';
|
Welcome Guest, Not a member yet? Register Sign In |