Skip to main content

I think <frontend_model> works for you as like Magento1

<field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Emails To</label>
                    <validate>validate-email</validate>
                    <frontend_model>YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field\Disable</frontend_model>
                </field>

and your frontend_model class should be

<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Disable extends \Magento\Config\Block\System\Config\Form\Field
{    
    protected function _getElementHtml(AbstractElement $element)
    {
        $element->setDisabled('disabled');
        return $element->getElementHtml();
 
    }
}

I think <frontend_model> works for you as like Magento1

<field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Emails To</label>
                    <validate>validate-email</validate>
                    <frontend_model>YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field\Disable</frontend_model>
                </field>

and your frontend_model class should be

<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Disable extends \Magento\Config\Block\System\Config\Form\Field
{    
    protected function _getElementHtml(AbstractElement $element)
    {
        $element->setDisabled('disabled');
        return $element->getElementHtml();
 
    }
}

I think <frontend_model> works for you as like Magento1

<field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Send Emails To</label>
    <validate>validate-email</validate>
    <frontend_model>YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field\Disable</frontend_model>
</field>

and your frontend_model class should be

<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Disable extends \Magento\Config\Block\System\Config\Form\Field
{    
    protected function _getElementHtml(AbstractElement $element)
    {
        $element->setDisabled('disabled');
        return $element->getElementHtml();
    }
}
deleted 81 characters in body
Source Link
Keyur Shah
  • 18.1k
  • 6
  • 67
  • 80

I think <frontend_model> works for you as like Magento1

<field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Emails To</label>
                    <validate>validate-email</validate>
                    <frontend_model>YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field\Disable</frontend_model>
                </field>

and your frontend_model class should be

<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Disable extends \Magento\Config\Block\System\Config\Form\Field
{    
    protected function _getElementHtml(AbstractElement $element)
    {
        $element->setDisabled('disabled');
        return $element->getElementHtml();

    }
}

May be another method available for this,But right now it works fine for you.

I think <frontend_model> works for you as like Magento1

<field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Emails To</label>
                    <validate>validate-email</validate>
                    <frontend_model>YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field\Disable</frontend_model>
                </field>

and your frontend_model class should be

<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Disable extends \Magento\Config\Block\System\Config\Form\Field
{    
    protected function _getElementHtml(AbstractElement $element)
    {
        $element->setDisabled('disabled');
        return $element->getElementHtml();

    }
}

May be another method available for this,But right now it works fine for you.

I think <frontend_model> works for you as like Magento1

<field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Emails To</label>
                    <validate>validate-email</validate>
                    <frontend_model>YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field\Disable</frontend_model>
                </field>

and your frontend_model class should be

<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Disable extends \Magento\Config\Block\System\Config\Form\Field
{    
    protected function _getElementHtml(AbstractElement $element)
    {
        $element->setDisabled('disabled');
        return $element->getElementHtml();

    }
}
Source Link
Keyur Shah
  • 18.1k
  • 6
  • 67
  • 80

I think <frontend_model> works for you as like Magento1

<field id="recipient_email" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Emails To</label>
                    <validate>validate-email</validate>
                    <frontend_model>YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field\Disable</frontend_model>
                </field>

and your frontend_model class should be

<?php
namespace YOUR_NAMESPACE\YOUR_MODULE\Block\System\Config\Form\Field;

use Magento\Framework\Data\Form\Element\AbstractElement;

class Disable extends \Magento\Config\Block\System\Config\Form\Field
{    
    protected function _getElementHtml(AbstractElement $element)
    {
        $element->setDisabled('disabled');
        return $element->getElementHtml();

    }
}

May be another method available for this,But right now it works fine for you.