I wanted to minimize my URL but I am having a problem. My route in Routes.php looks like this:
$route["news/(:num)"] = "home/news/$news";
In Home
controller I have news
function which takes a paramater $news
.
This is working http://localhost/bestcarsinfo/home/news/7
But when I use new URL version http://localhost/bestcarsinfo/news/7
I am getting error saying:
Undefined variable: news
in
config/routes.php