Skip to content

Instantly share code, notes, and snippets.

@shawnsandy
Created February 21, 2017 05:02
Show Gist options
  • Save shawnsandy/e7a34d4b92d1310d36c3a9cc2c161ca9 to your computer and use it in GitHub Desktop.
Save shawnsandy/e7a34d4b92d1310d36c3a9cc2c161ca9 to your computer and use it in GitHub Desktop.
Gist Content Methods
<?php
/**
* @param array $data
* @return bool
*/
function create($data = [])
{
if (empty($data)) return FALSE;
$content = [
'files' => [
$data['filename'] => [
'content' => $data['content']
]
],
'public' => $data['public'],
'description' => $data['description']
];
return $this->api()->create($content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment