Welcome Guest, Not a member yet? Register   Sign In
Undefined index
#2

[eluser]Rick Jolly[/eluser]
Question #1:

Use
Code:
if (isset($data['message']]))
{
   // ...
}

Question #2:

Use a class variable for $data to access it in more than one method of the same controller:
Code:
class Something extends Controller
{
  var $data = array();

  activation
  {
    $this->data['message'] = 'Activation complete. You can now start your plan.';
  }

  index
  {
    if (isset($this->data['message']))
    {
       // do something
    }
  }
}


Messages In This Thread
Undefined index - by El Forum - 06-30-2007, 09:50 AM
Undefined index - by El Forum - 06-30-2007, 11:22 AM
Undefined index - by El Forum - 06-30-2007, 04:28 PM
Undefined index - by El Forum - 06-30-2007, 11:57 PM
Undefined index - by El Forum - 07-01-2007, 04:16 AM
Undefined index - by El Forum - 07-01-2007, 06:15 AM
Undefined index - by El Forum - 07-01-2007, 10:20 AM
Undefined index - by El Forum - 07-01-2007, 02:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB