2016-10-22 5 views
1

Cloudyへのリクエストの後、私のギャラリーが作成されています。1つのリクエストで曇りのタグでリソースを受信する方法

$api = new \App\cloudinaryGallery; 
$api->resources(); 

Response {#176 ▼ 
    +"rate_limit_reset_at": 1477141200 
    +"rate_limit_allowed": 500 
    +"rate_limit_remaining": 499 
    flag::STD_PROP_LIST: false 
    flag::ARRAY_AS_PROPS: false 
    iteratorClass: "ArrayIterator" 
    storage: array:2 [▼ 
    "resources" => array:10 [▼ 
     0 => array:11 [▼ 
     "public_id" => "tiltkomp/gallery/kreoart" 
     "format" => "jpg" 
     "version" => 1477075563 
     "resource_type" => "image" 
     "type" => "upload" 
     "created_at" => "2016-10-21T18:46:03Z" 
     "bytes" => 1766084 
     "width" => 1920 
     "height" => 2607 
     "url" => "http://res.cloudinary.com/djxgexgng/image/upload/***************/tiltkomp/gallery/kreoart.jpg" 
     "secure_url" => "https://res.cloudinary.com/djxgexgng/image/upload/***************/tiltkomp/gallery/kreoart.jpg" 
     ] 
     1 => array:11 [▶] 
     2 => array:11 [▶] 
     3 => array:11 [▶] 
     4 => array:11 [▶] 
     5 => array:11 [▶] 
     6 => array:11 [▶] 
     7 => array:11 [▶] 
     8 => array:11 [▶] 
     9 => array:11 [▶] 
    ] 
    ] 
} 

リクエストテーブルにタグに関する情報がありません。

Response {#178 ▼ 
    +"rate_limit_reset_at": 1477141200 
    +"rate_limit_allowed": 500 
    +"rate_limit_remaining": 497 
    flag::STD_PROP_LIST: false 
    flag::ARRAY_AS_PROPS: false 
    iteratorClass: "ArrayIterator" 
    storage: array:14 [▼ 
    "public_id" => "tiltkomp/gallery/bodnar" 
    "format" => "jpg" 
    "version" => 1477075543 
    "resource_type" => "image" 
    "type" => "upload" 
    "created_at" => "2016-10-21T18:45:43Z" 
    "bytes" => 976947 
    "width" => 1920 
    "height" => 1489 
    "url" => "http://res.cloudinary.com/djxgexgng/image/upload/***************/tiltkomp/gallery/bodnar.jpg" 
    "secure_url" => "https://res.cloudinary.com/djxgexgng/image/upload/***************/tiltkomp/gallery/bodnar.jpg" 
    "tags" => array:2 [▼ 
     0 => "all" 
     1 => "shop" 
    ] 
    "derived" => array:4 [▶] 
    ] 
} 

はどのようにそれがより効果的で行うには:タグ情報を受信するには、私は、各ピクチャ

foreach ($pictures['resources'] as $pic) { 
    $path_part = pathinfo($pic['url']); 
    $tags = $api->resource($api->path . $path_part['filename']);  
    $picturesName[basename($pic['url'])] = $tags; 
} 

と受信用のループにリクエストを送信する必要がありますか? 1回のリクエストで写真やタグに関する情報を受け取る方法はありますか?

答えて

1

バルクリスト方式の応答の一部としてタグが含まれます以下:

$api->resources(array("tags" => TRUE)); 
関連する問題