[eluser]K.Brown[/eluser]
I'm working on my first CI app--so bear with me.
I'm setting up my page views like this:
Code:
<?php
class Event extends Application
{
function Admin()
{
parent::Application();
}
function index()
{
$this->load->view('include/head');
$this->load->view('include/home');
$this->load->view('top');
$this->load->view('featured');
$this->load->view('eventslist');
$this->load->view('footer');
}
function other()
{
$this->load->view('include/head');
$this->load->view('include/home');
$this->load->view('top');
$this->load->view('page');
$this->load->view('footer');
}
}
The action is happening in the top view right now:
Code:
<div id="topnav">
<?php
if(logged_in())
{?>
<p>Hey!</p>
<ul>
<li><?php echo anchor('logout', 'Logout'); ?></li>
<li><?php echo anchor('create', 'Create'); ?></li>
</ul>
<?php }
else
{?>
<form method="POST" action="index.php/login" id="login">
Username/Email:<br />
<input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" class="form" /><?php echo form_error('username'); ?>
Password:<br />
<input type="password" name="password" value="<?php echo set_value('password'); ?>" size="50" class="form" /><?php echo form_error('password'); ?>
<input type="submit" value="Login" name="login" />
</form>
<?php } ?>
</div>
Sorry about my indenting...it may be hard to read.
I'm using this
auth system.
So my question is: Is this a good way to go about this? I think not!
I'd like to hear your input--I don't know any other way to do this, and I feel like it could be a little easier...perhaps I need to have a "logged_in" view and a "logged_out" view?