library/Haste/Dca/General.php
public static function addAliasToDca($strDca, array $arrGenerateAliasCallback, $strPaletteField, $arrPalettes = ['default'])
    {
        \Controller::loadDataContainer($strDca);

        $arrDca = &$GLOBALS['TL_DCA'][$strDca];

        // add to palettes
        foreach ($arrPalettes as $strPalette) {
            $arrDca['palettes'][$strPalette] = str_replace($strPaletteField . ',', $strPaletteField . ',alias,', $arrDca['palettes'][$strPalette]);
        }

        // add field
        $arrDca['fields']['alias'] = static::getAliasField($arrGenerateAliasCallback);
    }
public static function addAliasToDca($strDca, array $arrGenerateAliasCallback, $strPaletteField, $arrPalettes = ['default'])
    {
        \Controller::loadDataContainer($strDca);

        $arrDca = &$GLOBALS['TL_DCA'][$strDca];

        // add to palettes
        foreach ($arrPalettes as $strPalette) {
            $arrDca['palettes'][$strPalette] = str_replace($strPaletteField . ',', $strPaletteField . ',alias,', $arrDca['palettes'][$strPalette]);
        }

        // add field
        $arrDca['fields']['alias'] = static::getAliasField($arrGenerateAliasCallback);
    }
public static function addAliasToDca ( $ strDca , array $ arrGenerateAliasCallback , $ strPaletteField , $ arrPalettes = [ 'default' ] ) { \ Controller :: loadDataContainer ( $ strDca ) ; $ arrDca = & $ GLOBALS [ 'TL_DCA' ] [ $ strDca ] ; // add to palettes foreach ( $ arrPalettes as $ strPalette ) { $ arrDca [ 'palettes' ] [ $ strPalette ] = str_replace ( $ strPaletteField . ',' , $ strPaletteField . ',alias,' , $ arrDca [ 'palettes' ] [ $ strPalette ] ) ; } // add field $ arrDca [ 'fields' ] [ 'alias' ] = static :: getAliasField ( $ arrGenerateAliasCallback ) ; }
Adds an alias field to the dca and to the desired palettes

@param       $strDca
@param       $arrGenerateAliasCallback array The callback to call for generating the alias
@param       $strPaletteField          String The field after which to insert the alias field in the palettes
@param array $arrPalettes The palettes in which to insert the field
Adds an alias field to the dca and to the desired palettes