Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6143717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:33:25+00:00 2026-05-23T18:33:25+00:00

I am new to Magento. Some questions make me crazy in the tutorial on

  • 0

I am new to Magento. Some questions make me crazy in the tutorial on their document.
1, How to open the development mode in magento 1.5.1?

2,”Fatal error: Call to a member function load() on a non-object in D:\PHPWeb\mag\app\code\local\Magentotutorial\Weblog\controllers\IndexController.php on line 7″

It means I can not instantiate a model object. Someone help me. This is my code below.

Controller:

    class Magentotutorial_Weblog_IndexController extends Mage_Core_Controller_Front_Action {    
    public function testModelAction() {
        $params = $this->getRequest()->getParams();
        $blogpost = Mage::getModel('weblog/blogpost');
        echo("Loading the blogpost with an ID of ".$params['id']);
        $blogpost->load($params['id']);     
        $data = $blogpost->getData();
        var_dump($data);    
    } 
} 

Model:

class Magentotutorial_Weblog_Model_Blogpost extends Mage_Core_Model_Abstract {
    protected function _construct() {
        $this->_init('weblog/blogpost');
    }
} 

Config.xml:

    <config>
    <modules>
        <Magentotutorial_Weblog>
            <version>0.1.0</version>
        </Magentotutorial_Weblog>
    </modules>
    <frontend>
        <routers>
            <weblog>
                <use>standard</use>
                <args>
                    <module>Magentotutorial_Weblog</module>
                    <frontName>weblog</frontName>
                </args>
            </weblog>
        </routers>
    </frontend> 
    <models>
        <weblog>
            <class>Magentotutorial_Weblog_Model</class>
            <!-- 
            need to create our own resource, cant just
            use core_mysql4
            -->
            <resourceModel>weblog_mysql4</resourceModel>
        </weblog>
        <weblog_mysql4>
            <class>Magentotutorial_Weblog_Model_Mysql4</class>              
        </weblog_mysql4>
    </models>
</config>

And my database name is blog_posts. Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:33:26+00:00Added an answer on May 23, 2026 at 6:33 pm

    As per my previous comment, you need the mysql4 model class to have the class “talk” to the DB throught the Magento DB Abstraction Layer.

    The issue with your model instantiation should be due to the missing tag in your config file:

    <config>
        <modules>
            <Magentotutorial_Weblog>
                <version>0.1.0</version>
            </Magentotutorial_Weblog>
        </modules>
        <frontend>
            <routers>
                <weblog>
                    <use>standard</use>
                    <args>
                        <module>Magentotutorial_Weblog</module>
                        <frontName>weblog</frontName>
                    </args>
                </weblog>
            </routers>
        </frontend> 
        <global>
        <models>
            <weblog>
                <class>Magentotutorial_Weblog_Model</class>
                <!-- 
                need to create our own resource, cant just
                use core_mysql4
                -->
                <resourceModel>weblog_mysql4</resourceModel>
            </weblog>
            <weblog_mysql4>
                <class>Magentotutorial_Weblog_Model_Mysql4</class>              
            </weblog_mysql4>
        </models>
        </global>
    </config>
    

    Please let me know if this solves your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Magento, and i need some conceptual guide and/or references. I need
I am looking to create some new functionality to Magento. I am going to
Currently I’m having some difficulties with using new Magento's soap v2 from c# interface.
I'm new to Magento. I've read a dozen of questions here and posts on
Can Magento API create products with new attribute? I mean some attributes of the
I made some template changes to Magento's New Order transactional email template in the
I am new to magento and I am customizing some changes to product, catagory
Scenario: A new blank Magento with a category product and customer import with some
I'm currently working on a new Magento template, and I'm facing problems with jQuery.
I'm new to magento. Currently i'm developing two ecommerce sites using multi-store option in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.