Skip to content

Instantly share code, notes, and snippets.

@devi
Created June 2, 2011 07:35
Show Gist options
  • Save devi/1004075 to your computer and use it in GitHub Desktop.
Save devi/1004075 to your computer and use it in GitHub Desktop.
Don't expect an empty post
public function extract_post()
{
$required_fields = array(
'post-title',
'post-slug',
'post-status',
'post-layout',
'post-content',
'post-publish',
'post-expire'
);
$data = Arr::extract($this->request->post(), $required_fields);
if ( ! array_filter($data))
{
return FALSE;
}
return $data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment