示例#1
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Answer;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$answer = new Answer($client);
$answer->get(57);
try {
    $answer->delete();
} catch (Exception $e) {
    echo $e->getMessage();
}
示例#2
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Answer;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$answer = new Answer($client);
$answer->get(59);
try {
    $answer->comment('this is some comment');
} catch (Exception $e) {
    echo $e->getMessage();
}
示例#3
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Answer;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$answer = new Answer($client);
$answer->get(58);
$comments = $answer->getComments();
var_dump($comments);
$votes = $answer->getVotes();
var_dump($votes);
示例#4
0
<?php

require_once __DIR__ . '/../../vendor/autoload.php';
use Linkorb\AnswersClient\Client;
use Linkorb\AnswersClient\Answer;
// get the client
$client = new Client('http://answers.dev/api/v1/', 'kishanio', '11121992');
$answer = new Answer($client);
$answer->get(16);
try {
    $answer->vote();
} catch (Exception $e) {
    echo $e->getMessage();
}