I was looking for a way to modify the children table without having to rewrite the code each time the application is compiled.
and I came up with the idea of ​​implementing a Hook in the "parent-children.php" file.
I put the following code: (just before / * process requested operation * /)
Code: Select all
if ($ChildTable) {
$function_name = $ChildTable. '_init_child';
@include ("$currDir/hooks/$ChildTable.php");
if (function_exists ($function_name)) {{
$args = array ();
$render = $ function_name ($userPCConfig [$ChildTable], getMemberInfo (), $args);
}
}
This would allow to keep a lot of code without needing to rewrite it (or re-paste it).
In my case, for example, I change the number of 'records-per-page' and the 'tenplate':
Code: Select all
function DetailsComprobantes_init_child (& $ options, $ memberInfo, & $ args) {
foreach ($options as $x => $a) {
$options[$x]['template'] = 'children-DetailsComprobantes_new';
$options[$x]['records-per-page'] = '3';
}
return TRUE;
}
I hope it serves.
Any doubt I remain available.