Welcome Guest, Not a member yet? Register   Sign In
Message: Undefined variable: Using SPARKS and CI
#1

[eluser]debow[/eluser]
I'm sure this is a pretty simple error for most but I'm still learning CI and now I've went and tried adding SPARKS to it.

I'm following this tutorial and have it setup exactly like it from what I can tell but I get the following errors. See below code and error. Any thought or suggestions?

Thanks

The screencast I followed.
http://heybigname.com/2011/09/15/codeign...ns-and-n1/


Controller = fs.php
Code:
<?php

class Fs extends MY_Controller {
  
    function index()
    {  
        
        //echo '<pre>'; var_dump(Fsystem::all()); exit;
        $this->view_data['commands'] = Fsystem::all();
        
    }
}

Model = Fsystem.php
Code:
&lt;?php

class Fsystem extends ActiveRecord\Model
{
    static $belongs_to = array(
      array('user')  
    );
}

View = index.php
Code:
&lt;?if($commands):?&gt;
   &lt;?foreach($command as $command):?&gt;
  
        <li>
            &lt;?=$command->description?&gt;
        </li>
    &lt;?endforeach?&gt;
        
&lt;?else:?&gt;
    There are currently no commands.
&lt;?endif?&gt;

############
Error
############
Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: command

Filename: core/Loader.php(742) : eval()'d code

Line Number: 7
A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: core/Loader.php(742) : eval()'d code

Line Number: 7




Theme © iAndrew 2016 - Forum software by © MyBB