1

I have made button New Comment as well as controller NewComment.php.

When I try to redirect to controller I have ERR_TOO_MANY_REDIRECTS.

This is my button block code:

namespace Vendor\Module\Block\Adminhtml\Category\Edit;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
use Magento\Cms\Block\Adminhtml\Page\Edit\GenericButton;

class NewCommentButton extends GenericButton  implements ButtonProviderInterface
{

public function getButtonData()
{
    return [
        'label' => __('New Comment'),
        'class' => 'save primary',
        'sort_order' => 90,
        $this->getUrl('frontname/controller/newcomment')
    ];
}
}

Your Answer

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

Browse other questions tagged or ask your own question.