Giter Club home page Giter Club logo

wtfztmdbbundle's Introduction

Description

A Symfony2 Bundle for use together with the wtfzdotnet/php-tmdb-api TMDB Wrapper.

Installation

Install Composer

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Add the following to your require block in composer.json config

"wtfzdotnet/wtfz-tmdb-bundle": "~1.2"

Configuration

Add to your app/config/config.yml the following:

wtfz_tmdb:
    api_key: YOUR_API_KEY_HERE

That's all! Fire away!

Want to make use of default caching and/or logging?

This caching system will adhere to the TMDB API max-age values, if you have different needs like long TTL's you'd have to make your own implementation. We would be happy to intergrate more options, so please contribute.

wtfz_tmdb:
    api_key: YOUR_API_KEY_HERE
    cache:
        enabled: true
        #path: "%kernel.cache_dir%/tmdb"
    log:
        enabled: true
        #path: "%kernel.logs_dir%/tmdb.log"

Don't need the repositories?

You can disable repositories :

wtfz_tmdb:
    api_key: YOUR_API_KEY_HERE
    repositories:
        enabled: false

Don't need the twig extension?

You can disable the twig extension :

wtfz_tmdb:
    api_key: YOUR_API_KEY_HERE
    twig_extension:
        enabled: false

Usage

Obtaining the client

$client = $this->get('wtfz_tmdb.client');

Obtaining repositories

$movie = $this->get('wtfz_tmdb.movie_repository')->load(13);

An overview of all the repositories can be found in the services configuration repositories.xml.

There is also a Twig helper that makes use of the Tmdb\Helper\ImageHelper to output urls and html.

{{ movie.backdropImage|tmdb_image_url }}

{{ movie.backdropImage|tmdb_image_html('original', null, 50)|raw }}

For all all other interactions take a look at wtfzdotnet/php-tmdb-api.

wtfztmdbbundle's People

Contributors

wtfzdotnet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.