Version: 3
Bug Description
I would like to use {php} macro with valid php code but I am getting error. Malformed tag contents in ...
Steps To Reproduce
{php
$accessCssClass = 'btn-danger';
$accessText = '';
if ( $last_access ) {
$now = new \DateTime();
$to_time = $last_access->getTimestamp();
$from_time = $now->getTimestamp();
$minute = round(abs($to_time - $from_time) / 60, 2);
if ( $minute <= 20 ) {
$accessCssClass = 'btn-success';
$accessText = $presenter->translate("device.online", "Online");
}
else {
$accessCssClass = 'btn-warning';
$accessText = $presenter->translate("device.offline", "Offline");
}
}
else {
$accessText = $presenter->translate("device.never_connected", "Never connected");
}
}
<span class="btn btn-xs {$accessCssClass}">{$accessText}</span>
Possible Solution
The problem is with the second if else block. But I dont see any problem with the code inside.
Version: 3
Bug Description
I would like to use {php} macro with valid php code but I am getting error. Malformed tag contents in ...
Steps To Reproduce
Possible Solution
The problem is with the second if else block. But I dont see any problem with the code inside.