Welcome Guest, Not a member yet? Register   Sign In
[resolved] CI_Loader::include(Array)
#1

[eluser]gavincali[/eluser]
edit: apparently, the variable '$path' cannot be passed to a view... or maybe I'm still confused.


Here is part of my controller script:
Code:
...

  // call f() to determine children for current category,
  // place into hash 'children'
  $children = get_children($category_id, $category_tree);

  // call f() to determine path [breadcrumbs] for current category
  $path = get_path($category_id, $category_tree);

...

// load vars to pass to view, then call view
$viewdata = array();
$viewdata['children'] = $children;
$viewdata['path'] = $path;
    
$this->load->view('catview', $viewdata);

Here is part of my view:
Code:
<html>
<head>

</head>
<body bgcolor="FFFFCC">

<b>CATEGORY TOOL</b>

<p>

  
  &lt;?php


  if(count($path))
  {
    foreach($path as $key => $value)
    {
      echo "<a href=?category_id=$key>$value</a> > ";
      #echo $key,$value, "...";
    }
  }

  ?&gt;

...



Quote:A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: libraries/Loader.php

Line Number: 639
A PHP Error was encountered

Severity: Warning

Message: CI_Loader::include(Array) [function.CI-Loader-include]: failed to open stream: No such file or directory

Filename: libraries/Loader.php

Line Number: 639
A PHP Error was encountered

Severity: Warning

Message: CI_Loader::include() [function.include]: Failed opening 'Array' for inclusion (include_path='.:/web/apache/php/:/web/apache/php/ajusa:/usr/share/pear/data/symfony/bin:/usr/share/pear/symfony/config:/web/apache/php/ci/')

Filename: libraries/Loader.php

Line Number: 639


I am converting existing non-MVC code into the CodeIgniter framework, and I know my code works fine on its own. So, do error messages sound familiar to anyone out there, I hope?




Theme © iAndrew 2016 - Forum software by © MyBB