Welcome Guest, Not a member yet? Register   Sign In
Controller variable not being passed to view
#1

[eluser]Unknown[/eluser]
Hi,

I keep receiving the following error in one of my views:

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined variable: urlError

Filename: views/gs_error.php

Line Number: 15

Here is the controller code:

Code:
foreach($urlArray as $url)
{
  $url = SnagUrlCleaner($url);//clean supplied url
  $feedResult = $this->Add_Feed($url, $user);//returns true or false
  
  if($feedResult == false)//the url could not be found
  {
   $urlError[] = $url;
  }
}
if(isset($urlError))
{
  
  $data['urlError'] = $urlError;
  $this->load->view('gs_error', $data);
}

And here is the view code to display the var being passed:

Code:
<?php

  foreach($urlError as $thisError)
  {
   echo '<p><em>' . $thisError . "</em></p>";
  }
  
  ?&gt;


Can anyone tell why the variable called $urlError is not being passed to the view? I have not encountered an issue like this before with CI.


Messages In This Thread
Controller variable not being passed to view - by El Forum - 07-19-2007, 11:22 PM
Controller variable not being passed to view - by El Forum - 07-19-2007, 11:51 PM
Controller variable not being passed to view - by El Forum - 07-20-2007, 02:07 AM
Controller variable not being passed to view - by El Forum - 07-20-2007, 09:14 AM
Controller variable not being passed to view - by El Forum - 07-20-2007, 09:22 AM
Controller variable not being passed to view - by El Forum - 07-20-2007, 01:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB