Custom PHP file
You can have a custom php file that will have a function to be executed when users save, refresh, publish or unpublish records.
Create a new .php file and save it into /components/com_customtables/customphp
A special named function from this file will be executed.
Lets call the file "myfirsttable.php" for example.
The file must contain a function "ESCustom_myfirsttable" where "myfirsttable" is the name of the file.
Example:
<?php
use Joomla\CMS\Factory;
//The name of the method must include the name of the file
function ESCustom_myfirsttable($row, $row_old){
if(isset($row['id'])){
$custom_task = Factory::getApplication()->input->getCmd('custom_task');
if($custom_task == 'dothis'){
echo 'My secret business here';
die;
//Your custom code example
$db = JFactory::getDBO();
$query='UPDATE #__customtables_table_exployee SET es_firstname='.$db->quote(strtolower($row['es_firstname'])).' WHERE id='.$row['id'];
$db->setQuery( $query );
if (!$db->query()) die( $db->stderr());
}
}
}
Save it. Upload to your website's folder: /components/com_customtables/customphp
Then go to the back-end:
Components/Custom Tables/Tables
Select the table and click on "Advanced" tab, then select the Custom PHP file.