if I want call a global function from ‘phpfn’ to the API action , I got API internal error and Can’t find the error case even in log files
so I thought I am not writing the wright syntax, any way here what I have try :
$app->get('/Sections/{name}', function ($request, $response, $args) {
$action = $args["name"] ?? null; // Get the input value
if ($action !== null) {
$fetch_rander = Conn()->executeQuery("SELECT* FROM departments")->fetchAll();
$body = array();
$record_count = Count($fetch_rander);
$basepath = BasePath();
if ($record_count > 0) {
foreach ($fetch_rander as $row) {
$section_title = $row[$action."_section_name"];
$section_image = $row["image"];
$imageUrl = GetImageViewTag("image",$section_image);
$body[] = array("
<div class='column'>
<a href='ProductsList'>
<div class='card'>
<div class='section-img'>
$imageUrl
</div>
</div>
</a>
</div>
");
}
}
return $response->withJson($body);
});
the error cased after i add ‘GetImageViewTag()’ function
any idea , Thanx