Can I pass URL variables to the index function of a controller ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Can I pass URL variables to the index function of a controller ? (/showthread.php?tid=31433) |
Can I pass URL variables to the index function of a controller ? - El Forum - 06-18-2010 [eluser]sirwan.me[/eluser] Can I pass URL variables to the index function of a controller ? for example : Code: class Post extends Controller { Can I pass URL variables to the index function of a controller ? - El Forum - 06-18-2010 [eluser]Buso[/eluser] yes you can http://ellislab.com/codeigniter/user-guide/general/urls.html Can I pass URL variables to the index function of a controller ? - El Forum - 06-18-2010 [eluser]zhjx922[/eluser] $this->router->fetch_method() ? 是要这个? Can I pass URL variables to the index function of a controller ? - El Forum - 06-19-2010 [eluser]suba[/eluser] can pass variable to the index function. example: your url is www.example.com/test/45 you can get url value via two ways. 1 Code: $this->url->segment(n);// n means 1,2,3,4,etc., Code: class Test extends Controller in your view page Code: <html> Can I pass URL variables to the index function of a controller ? - El Forum - 06-19-2010 [eluser]sirwan.me[/eluser] hi suba when i do your second method it doesnt work.. it doesnt seem to allow it when i pass variables to the index function of a controller, but works with all the other functinos on in the controller |