Skip to main content

I want to load custom module collection in module template file :

I have my custom module which havehas table name  : tagdatatagdata

I want to load "tagdata" table data in my template file.

And yeah iI created a grid with UI component.

Please check my model file :

<?php namespace [vendor]\[module]\Model;   class Extratags extends \Magento\Framework\Model\AbstractModel {     function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = []) ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); } protected function _construct() { $this->_init('[vendor]\[module]\Model\ResourceModel\Extratags'); }   } 

I want to load custom module collection in module template file :

I have my custom module which have table name  : tagdata

I want to load "tagdata" table data in my template file.

And yeah i created grid with UI component.

Please check my model file :

namespace [vendor]\[module]\Model;   class Extratags extends \Magento\Framework\Model\AbstractModel {     function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = []) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); } protected function _construct() { $this->_init('[vendor]\[module]\Model\ResourceModel\Extratags'); }   } 

I want to load custom module collection in module template file :

I have my custom module which has table name:tagdata

I want to load "tagdata" table data in my template file.

And yeah I created a grid with UI component.

Please check my model file :

<?php namespace [vendor]\[module]\Model; class Extratags extends \Magento\Framework\Model\AbstractModel { function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = [] ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); } protected function _construct() { $this->_init('[vendor]\[module]\Model\ResourceModel\Extratags'); } } 
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 1298 characters in body
Source Link
Sneha Panchal
  • 896
  • 14
  • 31

I want to load custom module collection in module template file :

I have my custom module which have table name : tagdata

I want to load "tagdata" table data in my template file.

And yeah i created grid with UI component.

Please check my model file :

namespace [vendor]\[module]\Model; class Extratags extends \Magento\Framework\Model\AbstractModel { function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = []) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); } protected function _construct() { $this->_init('[vendor]\[module]\Model\ResourceModel\Extratags'); } } 

I want to load custom module collection in module template file :

I have my custom module which have table name : tagdata

I want to load "tagdata" table data in my template file.

And yeah i created grid with UI component.

I want to load custom module collection in module template file :

I have my custom module which have table name : tagdata

I want to load "tagdata" table data in my template file.

And yeah i created grid with UI component.

Please check my model file :

namespace [vendor]\[module]\Model; class Extratags extends \Magento\Framework\Model\AbstractModel { function __construct( \Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null, \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null, array $data = []) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); } protected function _construct() { $this->_init('[vendor]\[module]\Model\ResourceModel\Extratags'); } } 
Source Link
Sneha Panchal
  • 896
  • 14
  • 31

Magento 2 : How to get custom module collection in module template file

I want to load custom module collection in module template file :

I have my custom module which have table name : tagdata

I want to load "tagdata" table data in my template file.

And yeah i created grid with UI component.