PHP code example of ikoene / marvel-api-bundle

1. Go to this page and download the library: Download ikoene/marvel-api-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/ */

    

ikoene / marvel-api-bundle example snippets



// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Ikoene\MarvelApiBundle\IkoeneMarvelApiBundle(),
        );

        // ...
    }

    // ...
}



$client = $this->get('ikoene_marvel_api_client');

$response = $client->getCharacter(1009610);

var_dump($response);

$response = $client->getComicsForCharacter(1009610);

$comicFilter = new Ikoene\MarvelApiBundle\Entity\ComicFilter();
$comicFilter->setTitleStartsWith('Age of Ultron');
$comicFilter->setOrderBy('title');

$response = $client->getComicsForCharacter(1009610, $comicFilter);