Skip to content

Commit

Permalink
upload snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
mpmont committed Mar 9, 2012
1 parent 359ff13 commit ace4258
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions upload.sublime-snippet
@@ -0,0 +1,23 @@
<snippet>
<content><![CDATA[
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload()){
$error = array('error' => $this->upload->display_errors());
}
else{
$data = array('upload_data' => $this->upload->data());
echo "success";
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>upload</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
</snippet>

0 comments on commit ace4258

Please sign in to comment.