PHP code example of anime-db / my-anime-list-browser-bundle

1. Go to this page and download the library: Download anime-db/my-anime-list-browser-bundle 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/ */

    

anime-db / my-anime-list-browser-bundle example snippets


// app/appKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new AnimeDb\Bundle\MyAnimeListBrowserBundle\AnimeDbMyAnimeListBrowserBundle(),
    );
}

$browser = $this->get('anime_db.my_anime_list.browser');

$content = $browser->get('/anime/1');

use AnimeDb\Bundle\MyAnimeListBrowserBundle\Exception\BannedException;
use AnimeDb\Bundle\MyAnimeListBrowserBundle\Exception\NotFoundException;

try {
    $content = $browser->get('/anime/1');
} catch (BannedException $e) {
    // you are banned
} catch (NotFoundException $e) {
    // page not found
} catch (\Exception $e) {
    // other exceptions
}