Welcome Guest, Not a member yet? Register   Sign In
Category DB call convert to CI - Model/Controller help
#5

[eluser]Devon Lambert[/eluser]
Ok one more thing gTech, or anyone else who has any idea how this conversion works.

I'm trying to pass the $categories variable to my view file as an array but for some reason PHP is throwing back an undefined variable error.

Here is the code so far:

// In the controller //

Code:
$categories = $this->mdl_home->get_categories();
$this->load->view('view_file', $categories);

// In the view //

Code:
<ul>
&lt;?php foreach($name as $cat_name):?&gt;
<li>&lt;?php echo $cat_name;?&gt;</li>
&lt;?php endforeach;?&gt;
</ul>


Messages In This Thread
Category DB call convert to CI - Model/Controller help - by El Forum - 05-25-2008, 01:10 PM
Category DB call convert to CI - Model/Controller help - by El Forum - 05-25-2008, 02:25 PM
Category DB call convert to CI - Model/Controller help - by El Forum - 05-25-2008, 02:30 PM
Category DB call convert to CI - Model/Controller help - by El Forum - 05-25-2008, 03:03 PM
Category DB call convert to CI - Model/Controller help - by El Forum - 05-25-2008, 06:21 PM
Category DB call convert to CI - Model/Controller help - by El Forum - 05-25-2008, 06:30 PM
Category DB call convert to CI - Model/Controller help - by El Forum - 05-25-2008, 09:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB