Contao\Controller::prepareForWidget PHP Method

prepareForWidget() protected method

Convert a DCA file configuration to be used with widgets
Deprecation: Deprecated since Contao 4.0, to be removed in Contao 5.0. Use Widget::getAttributesFromDca() instead.
protected prepareForWidget ( array $arrData, string $strName, mixed $varValue = null, string $strField = '', string $strTable = '' ) : array
$arrData array The field configuration array
$strName string The field name in the form
$varValue mixed The field value
$strField string The field name in the database
$strTable string The table name
return array An array that can be passed to a widget
    protected function prepareForWidget($arrData, $strName, $varValue = null, $strField = '', $strTable = '')
    {
        @trigger_error('Using Controller::prepareForWidget() has been deprecated and will no longer work in Contao 5.0. Use Widget::getAttributesFromDca() instead.', E_USER_DEPRECATED);
        return \Widget::getAttributesFromDca($arrData, $strName, $varValue, $strField, $strTable);
    }