Contao\CoreBundle\DataContainer\PaletteManipulator::addLegend PHP Method

addLegend() public method

If the legend already exists, nothing will be changed.
public addLegend ( string $name, string | array $parent, string $position = self::POSITION_AFTER, boolean $hide = false ) : static
$name string
$parent string | array
$position string
$hide boolean
return static
    public function addLegend($name, $parent, $position = self::POSITION_AFTER, $hide = false)
    {
        $this->validatePosition($position);
        $this->legends[] = ['name' => $name, 'parents' => (array) $parent, 'position' => $position, 'hide' => (bool) $hide];
        return $this;
    }