CodeIgniter Forums
Sidebar view loads into all views but index view - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Sidebar view loads into all views but index view (/thread-45821.html)



Sidebar view loads into all views but index view - El Forum - 10-07-2011

[eluser]xbonez[/eluser]
In my views folder, I have the three following views:
index.php, registration.php, sidebar.php

Sidebar.php contains this code:

Code:
<div class="title_box">
                Login
            </div>  
            <div class="border_box">
                <div>
                    <br/>
                    &lt;?php echo form_open('login'); ?&gt;
                        <strong>Username:</strong> &lt;input type="text" name="username" size="13"/&gt;&lt;br/>
                        <strong>Password:</strong> &lt;input type="password" name="password" size="13"/&gt;&lt;br/>
                        <div class="login_button">
                            <p>&lt;input type="image" src="/igniter/assets/images/login.gif" name="login"&gt;&lt;/p>
                        </div>
                    &lt;/form&gt;
                    <div class="forgot_name">
                        <br/>
                        <a href="">Forgot username or password?</a>
                    </div>
                </div>
            </div>

At the appropriate place in index.php and registration.php, I do:

Code:
$this->load_>view('sidebar');

This brings up my sidebar just as expected in the registration view, but in the index view, I get this error:

Code:
Fatal error: Call to undefined function form_open() in C:\wamp\www\igniter\application\views\sidebar.php on line 19

Where am I going wrong? I've spent hours trying to fix it.