listComments

The listComments hook is triggered when listing comment from unknown source in the back end. It passes the current record as argument and expects a string as return value.

Available

from Contao 2.8.0-RC2.

Parameters

  1. array $arrRow

    The current comment record data.

Return Values

Return a string representing your comment, or an empty string if your method is not responsible for the source table.

Example

<?php

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

// MyClass.php
public function myListComments($arrRow)
{
    if ($arrRow['source'] == 'tl_mytable')
    {
        return '<a href="contao/main.php?do=...">' . $arrRow['title'] . '</a>';
    }

    return '';
}

More information

References

See also

results matching ""

    No results matching ""