Welcome Guest, Not a member yet? Register   Sign In
Passing variables to views
#6

[eluser]Mike Ryan[/eluser]
Seconding jedd's post... if you only ever pass a single simple data type to a view I can see how this would be inconvenient. However, I think the flexibility added by this approach is worth such a trivial annoyance.

If it really bugs you, open system/libraries/loader.php and change line 307 to:
Code:
return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $vars, '_ci_return' => $return)); //untested

ironlung's example could be even shorter:

Code:
$data['colors'] = array('red','green','blue');
//... which isn't much longer than:
$colors = array('red','green','blue');


Messages In This Thread
Passing variables to views - by El Forum - 04-11-2009, 04:23 AM
Passing variables to views - by El Forum - 04-11-2009, 04:31 AM
Passing variables to views - by El Forum - 04-11-2009, 04:56 AM
Passing variables to views - by El Forum - 04-11-2009, 05:22 AM
Passing variables to views - by El Forum - 04-11-2009, 05:25 AM
Passing variables to views - by El Forum - 04-11-2009, 05:52 AM
Passing variables to views - by El Forum - 04-11-2009, 06:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB