0

I need a help to convert below code to Magento 2.

class Grid extends \Magento\Backend\Block\Widget\Grid
{
    protected function _prepareColumns() {

    $this->addColumn('entity_id', array(
            'header'    => Mage::helper('customer')->__('ID'),
            'width'     => '50px',
            'index'     => 'mageuserid',
            'type'  => 'number',
            'filter_index' => 'main_table.mageuserid'
        ));
    }
}

Specifically Mage::helper('customer')->__('ID')

1 Answer 1

1

You can simply use __('ID'). This is because Mage::helper('customer')->__('ID') used for translation only. They are equal.

5
  • So, will it become 'header' => __('ID') ? Commented Jan 8, 2017 at 13:51
  • @AbhishekAnand yes, it is. Commented Jan 8, 2017 at 13:53
  • Thanks for that, could you also help me converting this $groups=Mage::getModel('mppartnergroup/mppartnergroup')->addFieldToFilter('status',array('eq'=>1)) Commented Jan 8, 2017 at 14:02
  • @AbhishekAnand you should open new question, I will take a look and answer you. Because, it's more complicated. I need to clarify some info. Commented Jan 8, 2017 at 14:04
  • 1
    you are right, created new thread for that magento.stackexchange.com/questions/153675/… Commented Jan 8, 2017 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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