Welcome Guest, Not a member yet? Register   Sign In
[solved] - strange error
#11

[eluser]danushka[/eluser]
Hi are the views

template.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html &gt;
&lt;head&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt;
&lt;link href="./css/default.css" rel="stylesheet" type="text/css" /&gt;
[removed][removed]
&lt;/head&gt;
&lt;body&gt;
<div id="wrapper">
  <div id="header">
  &lt;?php $this->load->view('header');?&gt;
  </div>
  <div id="nav">
  &lt;?php $this->load->view('navigation');?&gt;
  </div>
  <div id="main">
  &lt;?php $this->load->view($main);?&gt;
  </div>
  <div id="footer">
  &lt;?php $this->load->view('footer');?&gt;
  </div>
</div>
&lt;/body&gt;
&lt;/html&gt;

home.php

Code:
<div id='pleft'>
&lt;?php
   echo "<img src='".$mainf[' border='0' align='left'/>\n";
   echo "<h2>".$mainf['name']."</h2>\n";
   echo "<p>".$mainf['shortdesc'] . "<br/>\n";
   echo anchor('welcome/product/'.$mainf['id'],'see details') . "<br/>\n";
   echo anchor('welcome/cart/'.$mainf['id'],'buy now') . "</p>\n";
?&gt;
</div>
<div id='pright'>
&lt;?php
   foreach ($sidef as $key => $list){
     echo "<img src='".$list[' border='0' align='left'/>\n";
     echo "<h4>".$list['name']."</h4>\n";
     echo "<p>";
     echo anchor('welcome/product/'.$list['id'],'see details') . "<br/>\n";
     echo anchor('welcome/cart/'.$list['id'],'buy now') . "</p>\n";
   }
?&gt;
</div>

#12

[eluser]danmontgomery[/eluser]
Code:
$data['main']       =   $this->load->view('home',$home,true);

Code:
&lt;?php $this->load->view($main);?&gt;
#13

[eluser]danushka[/eluser]
[quote author="noctrum" date="1273690747"]
Code:
$data['main']       =   $this->load->view('home',$home,true);

Code:
&lt;?php $this->load->view($main);?&gt;
[/quote]

Can you explain it little more ?
#14

[eluser]danmontgomery[/eluser]
You're passing a view to the $main variable, then trying to load a view that is the contents of that view which you already loaded... I'm guessing that instead of:

Code:
&lt;?php $this->load->view($main);?&gt;

You want:

Code:
&lt;?php echo $main; ?&gt;
#15

[eluser]danushka[/eluser]
[quote author="noctrum" date="1273691888"]You're passing a view to the $main variable, then trying to load a view that is the contents of that view which you already loaded... I'm guessing that instead of:

Code:
&lt;?php $this->load->view($main);?&gt;

You want:

Code:
&lt;?php echo $main; ?&gt;
[/quote]

No that was not the case

When i set $data['main']='home'; that error vanished. So that is the problem. before that data['main'] ( in the Controller ) was not a string, thus causing this error.

Yay , DUBUGGED !!!!!

Thanks Guys for your help !




Theme © iAndrew 2016 - Forum software by © MyBB