In CodeIgniter framework i have two controller files: controllerA.php and controllerB.php
I need controllerB.php to add code in controllerA.php function
I have no idea how to do it, i checked Codeigniter manual, google and stackoverflow but was not able to find solution
controllerA.php has function:
function get_permission_conditions()
{
return do_action('staff_permissions_conditions', [
'contracts' => [
'view' => true,
'view_own' => true,
'edit' => true,
'create' => true,
'delete' => true,
]);
}
I want controllerB.php to communicate with controllerA.php and add custom code example:
function get_permission_conditions()
{
//Code from controllerA.php
return do_action('staff_permissions_conditions', [
'contracts' => [
'view' => true,
'view_own' => true,
'edit' => true,
'create' => true,
'delete' => true,
//custom code from controllerB.php goes here
]);
}