getAttributesFromDca

The getAttributesFromDca hook is triggered when attributes of a widget are extracted from a Data Container array. It passes the attributes and the DCA object as arguments and expects the (modified) widget attributes as return value.

Available

from Contao 3.2.0.

Parameters

  1. array $arrAttributes

    An array of attributes.

  2. object $objDca

    The DataContainer object. It can be null if no object was passed to the Widget::getAttributesFromDca method.

Return Values

The return value should be the $arrAttributes array modified to your needs.

Example

<?php

// config.php
$GLOBALS['TL_HOOKS']['getAttributesFromDca'][] = array('MyClass', 'myGetAttributesFromDca');

// MyClass.php
public function myGetAttributesFromDca($arrAttributes, $objDca)
{
    // modify $arrAttributes as needed

    return $arrAttributes;
}

More Information

References

results matching ""

    No results matching ""