[eluser]ericsodt[/eluser]
I am running into something that I can not for the life of me figure out. I am running jquery and am having an issue where firebug is telling me theres an error, but the page renders fine.
Below is a simpler form of my
Model
Code:
var $id;
var $f_name;
var $l_name;
function Guest(){
parent::Model();
}
function createObject($arr){
$obj = $this->load->model("guest");
$obj->id = $arr->id;
$obj->f_name = $arr->f_name;
$obj->l_name = $arr->l_name;
return $obj;
}
The issue comes into play when I save my Guest Object into the session, then retrieve it to display it
Action
Code:
// get Array of Guest Objects from session
$couples = $this->session->userdata('coupleData');
// pick out one Guest Object by the guest id
$guestObj = $couples[$guestId];
// Load the food
$allFood = $this->food->getAllFood();
// display to page 'guest_profile_view'
$data = array(
'title' => 'my title',
'content' => 'guest_profile_view',
'module' => 'profile',
'guest' => $guestObj,
'foods' => $allFood
);
$this->load->view('layout/template/siteLayout',$data);
VIEW
Code:
...
<body>
<div class="profile">
<form name="profileForm" id="profileFormId" method="post" action="profile/save/1">
<div><span><?=$guest->f_name?></span></div>
</form>
</div>
</body>
...
The
rendered HTML looks fine
Code:
<html>
<head>
<link REL="shortcut icon" HREF="http://localhost/wedding/images/favicon.ico" type="image/x-icon"></link>
<title>Welcome to Dean & Jessies Wedding Website</title>
<link rel="stylesheet" type="text/css" href="http://localhost/wedding/css/global.css" ></link>
<!--[if gte IE 5]>
<link rel="stylesheet" type="text/css" href="http://localhost/wedding/css/ie-style.css"></link>
<![endif]-->
</head>
<body><div class="profile">
<form name="profileForm" id="profileFormId" method="post" action="profile/save/1">
<div><span>First Name</span></div>
</form>
</div>
</body>
[removed][removed]
<!--[removed][removed]-->
<!--[removed][removed]-->
</html>
However
fire bug renders this
Code:
<div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
2
3<h4>A PHP Error was encountered</h4>
4
5<p>Severity: Notice</p>
6<p>Message: Undefined index: js</p>
7<p>Filename: controllers/profile.php</p>
8<p>Line Number: 52</p>
9
10</div><html>
11 <head>
12 <link REL="shortcut icon" HREF="http://localhost/wedding/images/favicon.ico" type="image/x-icon"></link>
13 <title>Welcome to Dean & Jessies Wedding Website</title>
14
15 <link rel="stylesheet" type="text/css" href="http://localhost/wedding/css/global.css" ></link>
16
17 <!--[if gte IE 5]>
18 <link rel="stylesheet" type="text/css" href="http://localhost/wedding/css/ie-style.css"></link>
19 <![endif]-->
20
21 </head>
22
23<body><div class="profile">
24 <form name="profileForm" id="profileFormId" method="post" action="profile/save/1">
25 <div><span><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;">
26
27<h4>A PHP Error was encountered</h4>
28
29<p>Severity: Notice</p>
30<p>Message: Trying to get property of non-object</p>
31<p>Filename: views/guest_profile_view.php</p>
32<p>Line Number: 3</p>
33
34</div></span></div>
35 </form>
36</div>
37</body>
38
39 [removed][removed]
40 <!--[removed][removed]-->
41 <!--[removed][removed]-->
42</html>
Does any one have a clue as to why this is happening?????
Thanks!