Unable to display database table values on frontend in magento 2.1.7 The 2019 Stack Overflow Developer Survey Results Are InI just can't tell what is wrong with this Model code that save() is raising an exception.||Varien Data collection toOptionArray does not pass arguments to protected method?Magento 2: Duplicate key-sequence unique identity-constraint 'uniqueVirtualType' fatal error while di:compileCall to undefined method on custom collection Resource ModelModel class not found in …/magento/framework/ObjectManager/Factory/AbstractFactory.php:93Magento 2.1.6 Cannot save shipmentGet item collection by sku Magento 2Magento 2: toolbar url problems in custom module with custom routerMagento 2: How to override model resource configurable fileunable to solve the error in magento2

Old scifi movie from the 50s or 60s with men in solid red uniforms who interrogate a spy from the past

Are turbopumps lubricated?

Worn-tile Scrabble

Is bread bad for ducks?

How to display lines in a file like ls displays files in a directory?

Match Roman Numerals

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

I am an eight letter word. What am I?

Currents/voltages graph for an electrical circuit

APIPA and LAN Broadcast Domain

Has there been any research into whether euroscepticism is a function of age or of values?

Is it okay to consider publishing in my first year of PhD?

Are spiders unable to hurt humans, especially very small spiders?

A word that means fill it to the required quantity

How do PCB vias affect signal quality?

If a sorcerer casts the Banishment spell on a PC while in Avernus, does the PC return to their home plane?

Button changing its text & action. Good or terrible?

How to type a long/em dash `—`

Will it cause any balance problems to have PCs level up and gain the benefits of a long rest mid-fight?

How come people say “Would of”?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Star Trek - X-shaped Item on Regula/Orbital Office Starbases

How to charge AirPods to keep battery healthy?

Pokemon Turn Based battle (Python)



Unable to display database table values on frontend in magento 2.1.7



The 2019 Stack Overflow Developer Survey Results Are InI just can't tell what is wrong with this Model code that save() is raising an exception.||Varien Data collection toOptionArray does not pass arguments to protected method?Magento 2: Duplicate key-sequence unique identity-constraint 'uniqueVirtualType' fatal error while di:compileCall to undefined method on custom collection Resource ModelModel class not found in …/magento/framework/ObjectManager/Factory/AbstractFactory.php:93Magento 2.1.6 Cannot save shipmentGet item collection by sku Magento 2Magento 2: toolbar url problems in custom module with custom routerMagento 2: How to override model resource configurable fileunable to solve the error in magento2



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am trying to fetch table on frontend but getting this error




Fatal error: Class 'CrudCrudatfrontendModelResourceModelPost' not
found in
D:xampphtdocsnewmagvendormagentoframeworkObjectManagerFactoryAbstractFactory.php
on line 93





app/code/Crud/Crudatfrontend/
├── Block
│   └── index.php
├── etc
│    └── module.xml
├── Model
│   ├── Post.php
│   ├── ResourceModel
│   │   ├── Post
│   │   │   └── Collection.php
│   │   └── Post.php
├── registration.php
├── Setup
│   └── InstallSchema.php
└── view
└── frontend
├── layout
│   └── crud_index_index.xml
├── templates
   └── index.phtml


Here is my code,




Block/Index.php




<?php

namespace CrudCrudatfrontendBlock;

use MagentoFrameworkAppFilesystemDirectoryList;

class Index extends MagentoFrameworkViewElementTemplate

protected $_filesystem;

public function __construct(
MagentoFrameworkViewElementTemplateContext $context,
CrudCrudatfrontendModelPostFactory $postFactory
)

parent::__construct($context);
$this->_postFactory = $postFactory;


public function getResult()

$post = $this->_postFactory->create();
$collection = $post->getCollection();
return $collection;





Model/Post.php




<?php
namespace CrudCrudatfrontendModel;
class Post extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface

protected function _construct()

$this->_init('CrudCrudatfrontendModelResourceModelPost');


public function getIdentities()

return [self::CACHE_TAG . '_' . $this->getId()];


public function getDefaultValues()

$values = [];

return $values;





ModelResourceModelPost.php




<?php

namespace CrudCrudatfrontendModelResourceModel;

use MagentoFrameworkModelResourceModelDbAbstractDb;

class HelloWorld extends AbstractDb

/**
* Model initialization
*/
protected function _construct()

$this->_init('Crud_Crudatfrontend', 'post_id');





ModelResourceModelPostcollection.php




<?php
namespace CrudCrudatfrontendModelResourceModelPost;

class Collection extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection

/**
* Define resource model
*
* @return void
*/
protected function _construct()

$this->_init('CrudCrudatfrontendModelPost', 'CrudCrudatfrontendModelResourceModelPost');











share|improve this question




























    1















    I am trying to fetch table on frontend but getting this error




    Fatal error: Class 'CrudCrudatfrontendModelResourceModelPost' not
    found in
    D:xampphtdocsnewmagvendormagentoframeworkObjectManagerFactoryAbstractFactory.php
    on line 93





    app/code/Crud/Crudatfrontend/
    ├── Block
    │   └── index.php
    ├── etc
    │    └── module.xml
    ├── Model
    │   ├── Post.php
    │   ├── ResourceModel
    │   │   ├── Post
    │   │   │   └── Collection.php
    │   │   └── Post.php
    ├── registration.php
    ├── Setup
    │   └── InstallSchema.php
    └── view
    └── frontend
    ├── layout
    │   └── crud_index_index.xml
    ├── templates
       └── index.phtml


    Here is my code,




    Block/Index.php




    <?php

    namespace CrudCrudatfrontendBlock;

    use MagentoFrameworkAppFilesystemDirectoryList;

    class Index extends MagentoFrameworkViewElementTemplate

    protected $_filesystem;

    public function __construct(
    MagentoFrameworkViewElementTemplateContext $context,
    CrudCrudatfrontendModelPostFactory $postFactory
    )

    parent::__construct($context);
    $this->_postFactory = $postFactory;


    public function getResult()

    $post = $this->_postFactory->create();
    $collection = $post->getCollection();
    return $collection;





    Model/Post.php




    <?php
    namespace CrudCrudatfrontendModel;
    class Post extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface

    protected function _construct()

    $this->_init('CrudCrudatfrontendModelResourceModelPost');


    public function getIdentities()

    return [self::CACHE_TAG . '_' . $this->getId()];


    public function getDefaultValues()

    $values = [];

    return $values;





    ModelResourceModelPost.php




    <?php

    namespace CrudCrudatfrontendModelResourceModel;

    use MagentoFrameworkModelResourceModelDbAbstractDb;

    class HelloWorld extends AbstractDb

    /**
    * Model initialization
    */
    protected function _construct()

    $this->_init('Crud_Crudatfrontend', 'post_id');





    ModelResourceModelPostcollection.php




    <?php
    namespace CrudCrudatfrontendModelResourceModelPost;

    class Collection extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection

    /**
    * Define resource model
    *
    * @return void
    */
    protected function _construct()

    $this->_init('CrudCrudatfrontendModelPost', 'CrudCrudatfrontendModelResourceModelPost');











    share|improve this question
























      1












      1








      1








      I am trying to fetch table on frontend but getting this error




      Fatal error: Class 'CrudCrudatfrontendModelResourceModelPost' not
      found in
      D:xampphtdocsnewmagvendormagentoframeworkObjectManagerFactoryAbstractFactory.php
      on line 93





      app/code/Crud/Crudatfrontend/
      ├── Block
      │   └── index.php
      ├── etc
      │    └── module.xml
      ├── Model
      │   ├── Post.php
      │   ├── ResourceModel
      │   │   ├── Post
      │   │   │   └── Collection.php
      │   │   └── Post.php
      ├── registration.php
      ├── Setup
      │   └── InstallSchema.php
      └── view
      └── frontend
      ├── layout
      │   └── crud_index_index.xml
      ├── templates
         └── index.phtml


      Here is my code,




      Block/Index.php




      <?php

      namespace CrudCrudatfrontendBlock;

      use MagentoFrameworkAppFilesystemDirectoryList;

      class Index extends MagentoFrameworkViewElementTemplate

      protected $_filesystem;

      public function __construct(
      MagentoFrameworkViewElementTemplateContext $context,
      CrudCrudatfrontendModelPostFactory $postFactory
      )

      parent::__construct($context);
      $this->_postFactory = $postFactory;


      public function getResult()

      $post = $this->_postFactory->create();
      $collection = $post->getCollection();
      return $collection;





      Model/Post.php




      <?php
      namespace CrudCrudatfrontendModel;
      class Post extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface

      protected function _construct()

      $this->_init('CrudCrudatfrontendModelResourceModelPost');


      public function getIdentities()

      return [self::CACHE_TAG . '_' . $this->getId()];


      public function getDefaultValues()

      $values = [];

      return $values;





      ModelResourceModelPost.php




      <?php

      namespace CrudCrudatfrontendModelResourceModel;

      use MagentoFrameworkModelResourceModelDbAbstractDb;

      class HelloWorld extends AbstractDb

      /**
      * Model initialization
      */
      protected function _construct()

      $this->_init('Crud_Crudatfrontend', 'post_id');





      ModelResourceModelPostcollection.php




      <?php
      namespace CrudCrudatfrontendModelResourceModelPost;

      class Collection extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection

      /**
      * Define resource model
      *
      * @return void
      */
      protected function _construct()

      $this->_init('CrudCrudatfrontendModelPost', 'CrudCrudatfrontendModelResourceModelPost');











      share|improve this question














      I am trying to fetch table on frontend but getting this error




      Fatal error: Class 'CrudCrudatfrontendModelResourceModelPost' not
      found in
      D:xampphtdocsnewmagvendormagentoframeworkObjectManagerFactoryAbstractFactory.php
      on line 93





      app/code/Crud/Crudatfrontend/
      ├── Block
      │   └── index.php
      ├── etc
      │    └── module.xml
      ├── Model
      │   ├── Post.php
      │   ├── ResourceModel
      │   │   ├── Post
      │   │   │   └── Collection.php
      │   │   └── Post.php
      ├── registration.php
      ├── Setup
      │   └── InstallSchema.php
      └── view
      └── frontend
      ├── layout
      │   └── crud_index_index.xml
      ├── templates
         └── index.phtml


      Here is my code,




      Block/Index.php




      <?php

      namespace CrudCrudatfrontendBlock;

      use MagentoFrameworkAppFilesystemDirectoryList;

      class Index extends MagentoFrameworkViewElementTemplate

      protected $_filesystem;

      public function __construct(
      MagentoFrameworkViewElementTemplateContext $context,
      CrudCrudatfrontendModelPostFactory $postFactory
      )

      parent::__construct($context);
      $this->_postFactory = $postFactory;


      public function getResult()

      $post = $this->_postFactory->create();
      $collection = $post->getCollection();
      return $collection;





      Model/Post.php




      <?php
      namespace CrudCrudatfrontendModel;
      class Post extends MagentoFrameworkModelAbstractModel implements MagentoFrameworkDataObjectIdentityInterface

      protected function _construct()

      $this->_init('CrudCrudatfrontendModelResourceModelPost');


      public function getIdentities()

      return [self::CACHE_TAG . '_' . $this->getId()];


      public function getDefaultValues()

      $values = [];

      return $values;





      ModelResourceModelPost.php




      <?php

      namespace CrudCrudatfrontendModelResourceModel;

      use MagentoFrameworkModelResourceModelDbAbstractDb;

      class HelloWorld extends AbstractDb

      /**
      * Model initialization
      */
      protected function _construct()

      $this->_init('Crud_Crudatfrontend', 'post_id');





      ModelResourceModelPostcollection.php




      <?php
      namespace CrudCrudatfrontendModelResourceModelPost;

      class Collection extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection

      /**
      * Define resource model
      *
      * @return void
      */
      protected function _construct()

      $this->_init('CrudCrudatfrontendModelPost', 'CrudCrudatfrontendModelResourceModelPost');








      database collection magento-2.1.7 resource-model






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      Bhakti ThakkarBhakti Thakkar

      574114




      574114




















          1 Answer
          1






          active

          oldest

          votes


















          2














          Resources class name is wrong




          class HelloWorld extends AbstractDb




          it should be




          class Post extends AbstractDb




          Change it to ModelResourceModelPost.php






          share|improve this answer























          • Ah, how can I miss this. Thanks

            – Bhakti Thakkar
            2 days ago











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269353%2funable-to-display-database-table-values-on-frontend-in-magento-2-1-7%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Resources class name is wrong




          class HelloWorld extends AbstractDb




          it should be




          class Post extends AbstractDb




          Change it to ModelResourceModelPost.php






          share|improve this answer























          • Ah, how can I miss this. Thanks

            – Bhakti Thakkar
            2 days ago















          2














          Resources class name is wrong




          class HelloWorld extends AbstractDb




          it should be




          class Post extends AbstractDb




          Change it to ModelResourceModelPost.php






          share|improve this answer























          • Ah, how can I miss this. Thanks

            – Bhakti Thakkar
            2 days ago













          2












          2








          2







          Resources class name is wrong




          class HelloWorld extends AbstractDb




          it should be




          class Post extends AbstractDb




          Change it to ModelResourceModelPost.php






          share|improve this answer













          Resources class name is wrong




          class HelloWorld extends AbstractDb




          it should be




          class Post extends AbstractDb




          Change it to ModelResourceModelPost.php







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          Amit Bera♦Amit Bera

          59.9k1677178




          59.9k1677178












          • Ah, how can I miss this. Thanks

            – Bhakti Thakkar
            2 days ago

















          • Ah, how can I miss this. Thanks

            – Bhakti Thakkar
            2 days ago
















          Ah, how can I miss this. Thanks

          – Bhakti Thakkar
          2 days ago





          Ah, how can I miss this. Thanks

          – Bhakti Thakkar
          2 days ago

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f269353%2funable-to-display-database-table-values-on-frontend-in-magento-2-1-7%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

          Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?

          apt-get update fails to fetch files, “Temporary failure resolving …” errorWhy does apt-get fail to resolve the mirror?Apt-get update not working in Ubuntu 16.04 “temporary failure resolving”Ubuntu 16.04 Server updates - Temporary failure resolving 'ro.archive.ubuntu.com'“Failed to fetch… Temporary failure resolving…” when trying to installTemporary failure resolving ca.archive.ubuntu.comUbuntu 18.04 sudo apt update doesn't work (Failed to Fetch)apt-get error: “Temporary failure resolving 'archive.ubuntu.com' ”“Temporary failure resolving us.archive.ubuntu.com” Live USB rescueTemporary failure resolving 'es.archive.ubuntu.com' on Ubuntu Server15.04 Server fails to update with failed to fetch temporary failure resolving errorsCan't install software from Software CenterApt-get failed to fetch from Ubuntu server with error code 404“Unable to connect” error with apt-get: possible proxy?v12.10 can't apt-get update111: Connection refused when trying apt updateSudo apt-get update