title: Check if parameter is set before checking post value in CodeIgniter
body: <p>I'm making some sort of blog in CodeIgniter.<br>
  A key aspect of a blog is the creation and updating of posts.</p>
  
  <p>I'd like to reuse the view I'm using for creating a post, to update it.<br>
  For this, I'd like to pass the post data to the form.</p>
  
  <p>When a validation error occurs, the form should display the data passed to it, instead of the parameter data.</p>
  
  <p>So I want to pass data to the form, but after posting, the <code>set_value</code> method must override the parameter.</p>
  
  <p>So far, I have this form to create a post.<br>
  As said before, I'd like to adapt this form so I can reuse it for updating a post.</p>
  
  <pre><code>&lt;h2&gt;&lt;?php echo $title; ?&gt;&lt;/h2&gt;
  
  &lt;?php
      echo form_open('posts/' . $function);
      echo form_fieldset();
      echo '&lt;legend&gt;' . $title . '&lt;/legend&gt;';
  
      echo form_hidden('id', (isset($id) ? $id : '0'));
      echo form_input('title', set_value('title', 'Title'), 'size="50"');
      echo '&lt;input type="date" name="date" id="date" value="' . 
              form_prep(set_value('date', date('Y-m-d'))) . 
              '" /&gt;';
      echo form_textarea('content', set_value('content', ''));
      echo form_input('category', set_value('category', 'Category'), 'size="50"');
      echo form_input('keywords', set_value('keywords', 'Keywords'), 'size="50"');
  
      echo form_submit('submit', 'Submit');
      echo '&lt;input type="reset" name="clear" value="Clear" /&gt;';
  
      echo form_fieldset_close();
      echo form_close();
  ?&gt;
  </code></pre>
  
  <p><code>$function</code> is supposed to hold <em>create</em> or <em>update</em>.<br>
  <code>$title</code> is <em>Create post</em> or <em>Update post</em> and does not affect the forms function.<br>
  I already added a hidden field for the posts id, used when updating a post.</p>
  
  <p>I thought of using parameters sent to the view and using <code>isset</code> to check for their existance, thus making the difference between creating or updating a post. But this would conflict with the <code>set_value</code>.
  I'm not quite sure if it would be possible to post data to the form and what the consequences would be.</p>