[eluser]obay[/eluser]
Hi,
I am very new to CI, and I found out that when arrays are passed to views, the keys are converted to variables.
But I needed to pass an array to my view. So currently, this is my controller:
Code:
$user_levels = $this->User_model->get_user_levels();
$this->load->view('user_create_view', array("user_levels" => $user_levels));
and my view:
Code:
User Level: <?=form_dropdown("level",$user_levels);?>
and it works. (By the way, $user_levels in my controller is an array)
I was just wondering if there was a better way to do this, as creating a new array to wrap my existing array $user_levels seemed,.. uhh.. redundant...
Any ideas?
Thanks