PHP code example of blomstra / trello-php

1. Go to this page and download the library: Download blomstra/trello-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

blomstra / trello-php example snippets


$client = new \Trello\Client($api_key);

$url = $client->getAuthorizationUrl('some app name', 'http://myapp.com/returnurl'));
header("Location: {$url}");

$client->setAccessToken($returned_token);

$member_obj = new \Trello\Models\Member($client);
$member_obj->setId('userid');
$orgs = $member_obj->getOrganizations();

$board = $client->getBoard($board_id);

$board = new \Trello\Models\Board($client);
$board->setId($board_id);
$board = $board->get();

$cards = $board->getCards();

$card = $board->getCard($card_id);

$card->name = 'some new name';
$card->save();

$card = new \Trello\Models\Card($client);
$card->name = 'some card name';
$card->desc = 'some card desc';
$card->idList = $list_id;
$card->save();
bash
$ composer