Question

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

I could not call resource model function display records in block/dotnet.php

Was it helpful?

Solution

Instead of Mage::getModel('dotnet/dotnet')->displayrecods() use:

Mage::getResourceModel('dotnet/dotnetmodel')->displayrecods()

Or better yet in your model (dotnet/dotnet) create a method named displayrecords so you will be able to use your original code. That method can look like this:

public function displayrecods(){
    return $this->_getResource()->displayrecods();
}

So this method will act like a wrapper for the method in the resource model.
[EDIT]
I think the problem is with your resource model declaration in config.xml

<dotnet_resource>
    <class>Departmen_DotNet_Model</class>
...

Should be

<dotnet_resource>
    <class>Departmen_DotNet_Model_Resource</class>
...

Next time post code, not screenshots of it

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top