I'm getting following error when I acces my form:

Class MP_Search_Block_Adminhtml_Option_Edit_Tab_Form contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Mage_Adminhtml_Block_Widget_Tab_Interface::getTabLabel) in C:\xampp\apps\magento\htdocs\app\code\local\MP\Search\Block\Adminhtml\Option\Edit\Tab\Form.php on line 169

I already implemented Mage_Adminhtml_Block_Widget_Tab_Interface:

class MP_Search_Block_Adminhtml_Option_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface {

So what am I missing?


You are missing some basic OOP principles obviously. Disregarding the class names, this is not a Magento issue at all.

The error message already provides the answer: Add a getTabLabel method to your block class.

Whenever a class implements one or multiple interfaces, all interface methods must exist within the implementing class. There is one exception though: classes declared abstract may delegate the implementation to a concrete subclass.

Read more about PHP object-oriented programming in the PHP Language Reference.

| improve this answer | |
  • Yes, that was the problem. I didn't realised that the method was missing. Thanks for the refernce though I have that site open all the time anyway. I'm very new to php programming so there's still a lot to learn. Thanks for the answer – mpfmon Jul 10 '15 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.