Extension creation with a customized class
Hello all,
I need some help or information ...
I used to use the loadFormField hook with a customized class (MonExtHooks) which was created with the extension creator tools in the back end.
The mechanic woks with previous contao version,but with the lastest , i got problems.
i put $GLOBALS['TL_HOOKS']['loadFormField'][] = array('MonExtHooks', 'loadFormField'); in the config.php of the MonExtHooks class
in the MonExtHooks.php i wrote the two following simple functions :
public function __construct()
{
//parent::__construct(); if no comment, an error occurs : Warning: Missing argument 1 for Contao\Module::__construct()
//and Fatal error: Call to a member function row() on a non-object in .....\system\modules\core\modules\Module.php on line 80
$this->import('BackendUser', 'User');
}
public function loadFormField(Widget $objWidget, $strForm, $arrForm ) {
$objWidget->class = 'MonExtHooks';
// doing something
// ......
return $objWidget;
}
but when i call the page where the form is, a lot accents appears (french language) and it seems that the interclassment has changed... (but it works without the extension creation )
I have the message : Warning: Cannot modify header information - headers already sent by ....\system\helper\functions.php:70
and finaly the return page is lost .. blank page nothing else in my application
Thank you for helping
regards
other issues about the loadFormField in a customized class
hello,
about my little but blocking problem
when the form has only only field, all is fine (so only one passage through the loadFormField method)
but thats not work with two and more (several passages through the loadFormField method)
and a warning : " Cannot modify header information - headers already sent by
..."
someone has an idea, please
regards