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

Change route rule to


PHP Code:
$route['property-sheet/(:any)'] = 'home/property-sheet/$1'


In your views or places to show url


PHP Code:
echo site_url('propert-sheet/'.url_title(property->title)) 

Bonus:
I would suggest you have another column e.g slug
Where you will save URL formatted titles so that you don't have to call url_title() every timeĀ 

Instead your code would be


PHP Code:
echo site_url('propert-sheet/'.property->slug
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