title: How to call model class method from controller in megento?
body: <p>I have created a new model class in checkout/type name Cartpage.php and it has a method name <code>addValue($id)</code>. Want to call this model class method from <code>saveShippingMethodAction()</code> in  OnepageController.php at Checkout/controllers. I have called in several ways but it gives me an error:</p>
  
  <blockquote>
    <p>Fatal error:  Call to a member function addValue() on a non-object in .../app/code/core/Mage/Checkout/controllers/OnepageController.php</p>
  </blockquote>
  
  <p><strong>I have tried:</strong></p>
  
  <pre><code>$myModel = Mage::getSingleton('checkout/cartpage');
  $return = $myModel-&gt;addValue($my_value);
  </code></pre>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>class Mage_Checkout_Model_Type_Cartpage extends  Mage_Sales_Model_Quote_Address_Total_Abstract
  {
          public function addValue($value)
      {
      return $value;
      }
  
  }
  </code></pre>
  
  <p>How can I call my custom model from OnepageController?</p>