Problem with passing data to view in codeigniter code.
- by Jagira
Hello,
I have a codeigniter code that is working on local Apache installation. But it does not work on Godaddy Hosting.
I have got other similar views and controllers which are working on Godaddy.
Following is the code. I have pasted only relevant code.
Controller:
function index() {
$this-load-model('Feedmodel');
$data['posts']=$this-Feedmodel-gethomedata();
$this-load-view('home',$data);
}
View:
Total
' .$post['title'].''; ?
The error that I am getting is
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: posts
Filename: views/home.php
Line Number: 59
A PHP Error was encountered
Severity: Warning
Message: Invalid argument supplied for foreach()
Filename: views/home.php
Line Number: 59