[eluser]TheFuzzy0ne[/eluser]
I
think I'm getting it, but I'd love to see a demo posted, i.e the code for view/controller/mock model/extended form_validation library.
If I can see your dilemma, I think I can help a bit better. My head is quite fuzzy today, I've been doing too much thinking...
However, there's nothing saying that set_value() must be used in the view. You can put it in your controller if you want to, and set the defaults there, so you'd only have something like this in your view:
Code:
#controller
...
if ( ! $user_id || ! $user = $this->my_model->get_user($user_id))
{
show_error('The user ID you specified does not exist');
}
$data['username'] = set_value('username', $user->username);
$this->load->view('some_view', $data);
...
# View
...
<input type="text" name="username" value="<?php echo $username; ?>" />
...
Hopefully that makes sense. Short of template parsing, I think it's impossible to keep your view any tidier. I don't see how it could be any simpler. If your requirements are different, please let me know.