Welcome Guest, Not a member yet? Register   Sign In
Routes with a variable
#3

(05-18-2019, 07:26 AM)cybersven Wrote: Hi,

Actually, I'm using routes like this :
$route['property-sheet/(:num)'] = 'home/property-sheet/$1';


My question, I would like to use a variable which will be stored in db or automatically generated and based on a title previously chosen by a user.

For example :

Title :
499 33rd Ave Apt 208, San Francisco, CA 94121


Url wanted :
https: //myWebSite.com/property-sheet/499-33rd-Ave-Apt-208_San-Francisco_CA_94121

How can I do ?

when you save url fro title, try this https://codeigniter.com/user_guide/helpe...#url_title

$title = "499 33rd Ave Apt 208, San Francisco, CA 94121";
$url_title = url_title($title,'-',true);
Reply


Messages In This Thread
Routes with a variable - by cybersven - 05-18-2019, 07:26 AM
RE: Routes with a variable - by php_rocs - 05-18-2019, 02:05 PM
RE: Routes with a variable - by cpltz - 05-18-2019, 11:15 PM
RE: Routes with a variable - by hollax - 05-19-2019, 04:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB