PHP code example of anime-db / world-art-browser-bundle

1. Go to this page and download the library: Download anime-db/world-art-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 / world-art-browser-bundle example snippets


// app/appKernel.php

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

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

$content = $browser->get('/animation/animation.php?id=1');

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

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