コード例 #1
0
ファイル: vote.php プロジェクト: linkorb/answers-client
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Comment;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$comment = new Comment($client);
$comment->get(5);
try {
    $comment->vote();
} catch (Exception $e) {
    echo $e->getMessage();
}
コード例 #2
0
ファイル: delete.php プロジェクト: linkorb/answers-client
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Comment;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$comment = new Comment($client);
$comment->get(6);
try {
    $comment->delete();
} catch (Exception $e) {
    echo $e->getMessage();
}
コード例 #3
0
ファイル: update.php プロジェクト: linkorb/answers-client
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Comment;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$comment = new Comment($client);
$comment->get(6);
$comment->setComment('this is update comment for id 2?');
try {
    $comment->update();
} catch (Exception $e) {
    echo $e->getMessage();
}