Welcome Guest, Not a member yet? Register   Sign In
Create dynamic SEO based url without function/controller name
#1

[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
#2

[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
#3

[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;
}
}
#4

[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
#5

[eluser]xeroblast[/eluser]
sorry about that : $route['(:any)'] = 'controller_name/function_name/$1';
#6

[eluser]Was[/eluser]
Thanks Xeroblast

its perfect.


Was




Theme © iAndrew 2016 - Forum software by © MyBB