Created
February 21, 2017 05:02
-
-
Save shawnsandy/e7a34d4b92d1310d36c3a9cc2c161ca9 to your computer and use it in GitHub Desktop.
Gist Content Methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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