Welcome Guest, Not a member yet? Register   Sign In
Get Vars directly to the view (Cleaning Controller)
#1

[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)
    {        
        $data['vars'] = $vars;
        $data['id'] = $id;
        $data['name'] = $name;
        $data['abracadaba'] = $abracadaba;
        $this->load->view('news/news_view', $data);
    }

To something like this:

Code:
function index($vars, $id, $name, $abracadaba)
    {        
        $this->load->vars($_GET); //for example
        $this->load->view('news/news_view', $data);
    }

In View

Code:
<html>
   <?=$vars?>  
   <?=$id?>  
   <?=$name?>
   <?=$abracadaba?>  
</html>

Any ideas? Smile

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....


Messages In This Thread
Get Vars directly to the view (Cleaning Controller) - by El Forum - 10-16-2008, 06:22 PM
Get Vars directly to the view (Cleaning Controller) - by El Forum - 10-16-2008, 06:26 PM
Get Vars directly to the view (Cleaning Controller) - by El Forum - 10-17-2008, 12:55 AM
Get Vars directly to the view (Cleaning Controller) - by El Forum - 10-17-2008, 03:40 AM
Get Vars directly to the view (Cleaning Controller) - by El Forum - 10-17-2008, 03:52 AM
Get Vars directly to the view (Cleaning Controller) - by El Forum - 10-17-2008, 04:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB