a starting point:
config.php
Code:
<?php
$GLOBALS['TL_HOOKS']['loadFormField'][] = array('MyHooks', 'myLoadFormField');
class MyHooks extends Controller {
public function MyLoadFormField(Widget $objWidget, $strForm, $arrForm) {
// formID is set in the Form Generator
if ($arrForm['formID'] != 'your_formID') {
return $objWidget;
}
$name = $objWidget->name;
switch ($name) {
case 'your_field_name':
// your code here
// see below for the link to the documentation
break;
}
return $objWidget;
}
the objWidget is an instance of Widget (or a class that extends Widget), documentation for CheckBox class:
http://api.contao.org/Controller/CheckBox.html
Bookmarks