![]() |
Get Vars directly to the view (Cleaning 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: Get Vars directly to the view (Cleaning Controller) (/showthread.php?tid=12376) |
Get Vars directly to the view (Cleaning Controller) - El Forum - 10-16-2008 [eluser]Dewos[/eluser] Hi all. For clean my Controller, i want to pass all $_GET vars from URI controller to view directly. From: Code: function index($vars, $id, $name, $abracadaba) To something like this: Code: function index($vars, $id, $name, $abracadaba) In View Code: <html> Any ideas? ![]() Ps. No, $this->input->get() is the same, i think. $this->uri->uri_string() maybe. But it loose the vars name, so it's a wrong way.... Get Vars directly to the view (Cleaning Controller) - El Forum - 10-16-2008 [eluser]Dewos[/eluser] Ops... wrong section. Sorry :| Get Vars directly to the view (Cleaning Controller) - El Forum - 10-17-2008 [eluser]xwero[/eluser] You have to enable query string in the config and set the uri protocol to PATH_INFO. But the query string pairs will not be attached to the controller method. That is only for url segments. Get Vars directly to the view (Cleaning Controller) - El Forum - 10-17-2008 [eluser]Dewos[/eluser] [quote author="xwero" date="1224244543"]You have to enable query string in the config and set the uri protocol to PATH_INFO. But the query string pairs will not be attached to the controller method. That is only for url segments.[/quote] I know... But if vars are aviable in controller, why force to rebind all of them to use in view??. It should be set native by codeigniter controller... will be a real time-saving. Update: -func_get_args() useless :| Get Vars directly to the view (Cleaning Controller) - El Forum - 10-17-2008 [eluser]xwero[/eluser] There is nothing that stops you from doing this Code: <html> But i think you want to go back to the times where all REQUEST keys where reachable via a variable. This way of programming is insecure and error prone. Get Vars directly to the view (Cleaning Controller) - El Forum - 10-17-2008 [eluser]Dewos[/eluser] [quote author="xwero" date="1224255167"] There is nothing that stops you from doing this But i think you want to go back to the times where all REQUEST keys where reachable via a variable. This way of programming is insecure and error prone.[/quote] Ehmm... not and not ![]() So, no realistic way... so this is the end, my only friend, the end. |