PHP code example of anime-db / smotret-anime-browser-bundle

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


// app/appKernel.php

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

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

$content = $browser->get('translations');

$content = $browser->get('translations?feed=recent');

$content = $browser->get('translations?feed=id');

$content = $browser->get('translations?feed=id&afterId=10000');

$content = $browser->get('translations/905760');

$content = $browser->get('series');

$content = $browser->get('series?fields=id,title,typeTitle,posterUrlSmall');

$content = $browser->get('series?chips=genre@=8,35;genre_op=and');

$content = $browser->get('series?myAnimeListId=24133');

$content = $browser->get('series?query=gate');

$content = $browser->get('series/9866');

$content = $browser->get('episodes/102173');

$content = $browser->get('series?limit=1&offset=10');

use AnimeDb\Bundle\SmotretAnimeBrowserBundle\Exception\NotFoundException;

try {
    $content = $browser->get('series/1');
} catch (NotFoundException $e) {
    // series not found
} catch (\Exception $e) {
    // other exceptions
}