I have the following code in my connection view settings in body:
The if statement always return to the 'else', although $isCategorie = "categorie". What is wrong?
<?php
echo "<tr>";
$isCategorie = '{eigenschap}';
$categorieNaam = '{waarde}';
if ($isCategorie == "categorie") {
echo $categorieNaam . "<br>";
}
else {
echo "<td>".'{eigenschap}'."</td>
<td>{waarde}</td></tr>";
}
?>
The if statement always return to the 'else', although $isCategorie = "categorie". What is wrong?
<?php
echo "<tr>";
$isCategorie = '{eigenschap}';
$categorieNaam = '{waarde}';
if ($isCategorie == "categorie") {
echo $categorieNaam . "<br>";
}
else {
echo "<td>".'{eigenschap}'."</td>
<td>{waarde}</td></tr>";
}
?>
Hi,
This is because the PHP runs before the {field_name} replace is done, so your code should be:
if you want it to run the way you want!
Regards
Max
This is because the PHP runs before the {field_name} replace is done, so your code should be:
<?php
echo "<tr>";
$isCategorie = $MyRow->eigenschap;
$categorieNaam = '{waarde}';
if ($isCategorie == "categorie") {
echo $categorieNaam . "<br>";
}
else {
echo "<td>".'{eigenschap}'."</td>
<td>{waarde}</td></tr>";
}
?>
if you want it to run the way you want!
Regards
Max
Hi,
If you are using the latest V4 then you should use
Regards,
Max
If you are using the latest V4 then you should use
$row['field_name']
or $row['MODEL_ID']['field_name']
Regards,
Max
This topic is locked and no more replies can be posted.