0

I am using Magento 2. I made a small mistake unfortunately i am unable to find

Index.php

public function getBannerCollection(){
        $collection = $this->_bannerModel->getCollection()
        ->addFieldToSelect('*');
        return $collection;
    }

phtml

<?php $bannerCollection =  $block->getBannerCollection();
print_r($bannerCollection);?>

error

localhost:8080 is currently unable to handle this request.
HTTP ERROR 500

I made a small change but i can't find out can any one help me on this

But i can able to loop it

0

I got a solution on this. we need to use getData()

$bannerCollection->getData();

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.