[eluser]imcl[/eluser]
Haven't been able to figure this out yet:
I have a view file (main_view.php) which I use as my template.
It has a left-sided div for the menu, and another div for content:
Code:
<td width="200">
<div class="">
<?= $menu ?>
</div>
</td>
<td width="700">
<div class="">
<?= $content ?>
</div>
</td>
Say the left menu shows the following links:
Code:
- Update email
- Update Password
- Update Profile
How do I make different forms appear in the <?= $content?> div when each menu item is clicked?
I have no idea how to pass the following code to <?= $content?> (this is the change_email_form view from Tank_auth).
Any suggestions are much appreciated!
Code:
<?php
$password = array(
'name' => 'password',
'id' => 'password',
'size' => 30,
);
$email = array(
'name' => 'email',
'id' => 'email',
'value' => set_value('email'),
'maxlength' => 80,
'size' => 30,
);
?>
<?php echo form_open($this->uri->uri_string()); ?>
<table>
<tr>
<td><?php echo form_label('Password', $password['id']); ?></td>
<td><?php echo form_password($password); ?></td>
<td style="color: red;"><?php echo form_error($password['name']); ?><?php echo isset($errors[$password['name']])?$errors[$password['name']]:''; ?></td>
</tr>
<tr>
<td><?php echo form_label('New email address', $email['id']); ?></td>
<td><?php echo form_input($email); ?></td>
<td style="color: red;"><?php echo form_error($email['name']); ?><?php echo isset($errors[$email['name']])?$errors[$email['name']]:''; ?></td>
</tr>
</table>
<?php echo form_submit('change', 'Send confirmation email'); ?>
<?php echo form_close(); ?>