Skip to main content
edited body
Source Link
Devidas
  • 3.4k
  • 1
  • 28
  • 63
<?php

namespace Ashore\Faq\Block\Faq;Vendor\Faq\Block\Faq;

use Magento\Framework\App\RequestInterface;
use Ashore\Faq\Block\BaseBlock;Vendor\Faq\Block\BaseBlock;
use Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory;Vendor\Faq\Model\ResourceModel\Custom\CollectionFactory;

class Index extends \Magento\Framework\View\Element\Template 
{
    protected $mymodulemodelFactory;
    protected $request;

    public function __construct(
    CollectionFactory $mymodulemodelFactory,
    \Magento\Catalog\Block\Product\Context $context,
    RequestInterface $request,
    array $data = [] 
    )
    {
        parent::__construct($context, $data);
        $this->_request = $request;
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->getCollection();
        return $collection;
    }
}

Hey @Devidas I hope It's Work For you

<?php

namespace Ashore\Faq\Block\Faq;

use Magento\Framework\App\RequestInterface;
use Ashore\Faq\Block\BaseBlock;
use Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory;

class Index extends \Magento\Framework\View\Element\Template 
{
    protected $mymodulemodelFactory;
    protected $request;

    public function __construct(
    CollectionFactory $mymodulemodelFactory,
    \Magento\Catalog\Block\Product\Context $context,
    RequestInterface $request,
    array $data = [] 
    )
    {
        parent::__construct($context, $data);
        $this->_request = $request;
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->getCollection();
        return $collection;
    }
}

Hey @Devidas I hope It's Work For you

<?php

namespace Vendor\Faq\Block\Faq;

use Magento\Framework\App\RequestInterface;
use Vendor\Faq\Block\BaseBlock;
use Vendor\Faq\Model\ResourceModel\Custom\CollectionFactory;

class Index extends \Magento\Framework\View\Element\Template 
{
    protected $mymodulemodelFactory;
    protected $request;

    public function __construct(
    CollectionFactory $mymodulemodelFactory,
    \Magento\Catalog\Block\Product\Context $context,
    RequestInterface $request,
    array $data = [] 
    )
    {
        parent::__construct($context, $data);
        $this->_request = $request;
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->getCollection();
        return $collection;
    }
}

Hey @Devidas I hope It's Work For you

Source Link
Baharuni Asif
  • 1.3k
  • 10
  • 26

<?php

namespace Ashore\Faq\Block\Faq;

use Magento\Framework\App\RequestInterface;
use Ashore\Faq\Block\BaseBlock;
use Ashore\Faq\Model\ResourceModel\Custom\CollectionFactory;

class Index extends \Magento\Framework\View\Element\Template 
{
    protected $mymodulemodelFactory;
    protected $request;

    public function __construct(
    CollectionFactory $mymodulemodelFactory,
    \Magento\Catalog\Block\Product\Context $context,
    RequestInterface $request,
    array $data = [] 
    )
    {
        parent::__construct($context, $data);
        $this->_request = $request;
        $this->mymodulemodelFactory = $mymodulemodelFactory;
    }
    public function getCollection()
    {
        $collection = $this->mymodulemodelFactory->getCollection();
        return $collection;
    }
}

Hey @Devidas I hope It's Work For you