Welcome Guest, Not a member yet? Register   Sign In
Having a problem with $this->load->view();
#1

[eluser]ConnorD[/eluser]
Hi,

I am fairly experienced in PHP, but brand new to CI, so please bare with me. I have been having no trouble until I tried to load a view from my controller:

Code:
<?php
class Home extends Controller{
    function index(){
        parent::Controller();
    }
    function Home(){
        $data['title'] = "Livefootballtalk - Home";
        $data['intro'] = "Livefootballtalk is a soccer/football fan community where fans from all different countries and clubs can meet and discuss about world football competitions and players. Also, the fans may interact through their profile pages and messager. We invite you to be a real fan and <a href='register.php?step=1'>join</a> the community!";    
        
        
        $this->load->view('home', $data);
    }
}
?&gt;

I am getting an error message on my codeigniter page from my browser saying: "A PHP Error was encountered

Severity: Notice

Message: Undefined property: Home::$load

Filename: controllers/home.php

Line Number: 11".

I don't understand it, because I have done everything with the tutorials. Any help would be appreciated, thank you.

BTW, here is my view if it is of interest:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
&lt;html &gt;
&lt;head&gt;
&lt;title&gt;&lt;?php echo $title; ?&gt;&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
&lt;link rel="stylesheet" href="css/1.css" type="text/css" media="screen,projection" /&gt;
&lt;/head&gt;
&lt;body&gt;

        <div id="top">
        
        </div>
        
        <div id="container">
        
                <div id="menu">
                
                        <ul id="nav">

                        &lt;?php
                        
                        ?&gt;
                        
                        </ul>
                        
                        <br class="clear" />
                
                </div>
                
                
                
                <div id="sidebar">
                
                        <h1 class="first">
                        
                            Home
                        
                        </h1>
                        
                        <p>
                        
                        
                        </p>
                        
                        <h1>My Account</h1>
                        
                        <ul class="linkroll">
                        
                            &lt;?php
                            
                            ?&gt;

                            
                        </ul>
                        
                    
                
                </div>
                
                <div id="content">
                &lt;?php
                
                ?&gt;
                <br />
                
                        <h1>Welcome to Livefootballtalk!</h1>
                        <br />
                        <img src="../images/soccer_fans.jpg" width="380" height="280" /><br />
                        
                        <p>
                        &lt;?php
                        echo $intro;
                        ?&gt;
                        </p>
                        <br /><br />
                        &lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/dIlcc7Vks-8&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param>&lt;embed src="http://www.youtube.com/v/dIlcc7Vks-8&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed>&lt;/object&gt;    
                        </p>
                        <br />
                        &lt;?php
                        echo "<br><font color='black'>Latest Discussions:</font><br>";
                        foreach($threads_query->result() as $row){
                            echo "<table border='0'><tr><td>Subject: <br><br><a >subject'>$row->subject</a></td></tr><td><td>By: <a >username'>$row->username</a></td></tr></table></table><hr>";
                        }
                        ?&gt;
                </div>

                <div id="footer">
                    
                    <p>Copyright 2008 Livefootballtalk.com | <a href="mailto:[email protected]">[email protected]</a></p>        
        
                </div>
        
        </div>


&lt;/body&gt;
&lt;/html&gt;


Messages In This Thread
Having a problem with $this->load->view(); - by El Forum - 09-01-2008, 02:09 PM
Having a problem with $this->load->view(); - by El Forum - 09-01-2008, 02:47 PM
Having a problem with $this->load->view(); - by El Forum - 09-01-2008, 03:39 PM
Having a problem with $this->load->view(); - by El Forum - 09-01-2008, 04:35 PM
Having a problem with $this->load->view(); - by El Forum - 09-01-2008, 04:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB