• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding get routes name feature

#1
Smile 
Hi, Ci devs. 

I tried to get routes name in view files to make urls. but no success due to CI not offering that kind of feature yet. every time clients change the routes names. they have to go through view files and change routes names in urls manually. its a bit of pain.

I think it's a great feature to have in CI. 

Laravel have this feature builtin. 
Code:
Route::getCurrentRoute()->getPath();
Code:
Request::route()->getName()

But I persoally dont like laravel. its very bloated and slow.

I'm not a expert to do this kind of modification into the CI core. 

So I'm requesting this feature from CI devs. Kindly concider adding this feature.

Thanks for hard work Smile
Reply

#2
I don't exactly understand what you are trying to achieve, however to get the current method and class you can do something like this:

PHP Code:
$this->router->class;
$this->router->method


For example, if you have a default_controller and you connect to page "/", then
Code:
$this->router->class == default_controller
$this->router->method == index
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.