Your IP : 216.73.216.220


Current Path : /var/www/html/app/code/FlipsDigital/Faq/Block/
Upload File :
Current File : /var/www/html/app/code/FlipsDigital/Faq/Block/Index.php

<?php
namespace FlipsDigital\Faq\Block;

class Index extends \Magento\Framework\View\Element\Template
{
    protected $_faqFactory;
	public function __construct(
		\Magento\Framework\View\Element\Template\Context $context,
		\FlipsDigital\Faq\Model\FaqFactory $faqFactory
	)
	{
		$this->_faqFactory = $faqFactory;
		parent::__construct($context);
	}
    public function getFaqCollection(){
		$faq = $this->_faqFactory->create();
        $faqCollection = $faq->getCollection();
        $faqCollection->addAttributeToSelect('*');
        $faqCollection->addAttributeToFilter('is_active', 1);
        // foreach($faqCollection as $item){
		// 	echo "<pre>";
		// 	print_r($item->getData());
		// 	echo "</pre>";
		// }
		// exit();
		// return $this->_pageFactory->create();
		return $faqCollection;
	}
	public function _prepareLayout(){
		$this->pageConfig->getTitle()->set(__('Online Ordering System Frequently Asked Questions 網上訂購系統 FAQ'));
		return parent::_prepareLayout();
	}
}