php - Laravel 4 : Error in fetching photos from Flickr -


i using anahkiasen/flickering data flickr in laravel.

i new laravel. see had did fetching data flickr.

in homecontroller made 1 method

public function flicker()     {             $apikey = "my api key";             $apisecret = "my api secret";             $method = flickering::handshake($apikey,$apisecret);             $result = flickering::getresultsof('photosets.getlist', array('user_id' => '116552873@n04', 'per_page' => 20));                 echo "<pre>";print_r($result);echo "</pre>";die;     } 

this code throws error :

enter image description here

looking @ documentation:

to start working flickering, create new instance of example underneath. if set api credentials in config file, don't need pass arguments constructor automatically fetch key , secret key config files.

you need create new instance:

$flickering = new flickering\flickering($apikey, $apisecret); 

so:

$method = $flickering->handshake($apikey,$apisecret); $result = $flickering->getresultsof('photosets.getlist', array(     'user_id' => '116552873@n04',      'per_page' => 20 )); 

if want use facade then:

flickering\facades\flickering::handshake($apikey, $apisecret); 

i don't recommend way there no benefit in taking route, other option allows create more testable code.

you should read documentation: https://github.com/anahkiasen/flickering

edit: add these lines specified configuration section in config/app.php.

providers

'flickering\flickeringserviceprovider' 

aliases

flickering' => 'flickering\facades\flickering' 

it seems package creating error when creating new instance of class.

argument 1 passed flickering\flickering::__construct() must instance of illuminate\container\container, string given

this issue laravel 4.1 on part.

the facade working expected though:

flickering\facades\flickering::handshake("bar", "foo"); 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -