0

I want to access Laminas\Stdlib\Parameters Object data in that I can access video_url data in magento2. How can I access that object data ?

$product = $this->getRequest()->getFiles();
print_r($product);

Using that I got this below object but I want to access video_url data.

Laminas\Stdlib\Parameters Object
(
    [storage:ArrayObject:private] => Array
        (
            [product] => Array
                (
                    [video_url] => Array
                        (
                            [name] => file_example_MP4_480_1_5MG.mp4
                            [type] => video/mp4
                            [tmp_name] => /tmp/phpb5ZS51
                            [error] => 0
                            [size] => 1570024
                        )

                )

        )

)
0

using this belove code i got the solution

 $json  = json_encode($product);
 $array = json_decode($json, true);
 print_r($array['product']['video_url']);
0

You should try:

$productData = $product->get('product');

Where $productData content will be video_url index data.

1
  • that not working for me – Jay Parmar Jul 22 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.