conditional in one line php code example
Example 1: if online php
<?php echo ($requestVars->_name == '') ? $redText : ''; ?>
Example 2: write if and else in one line php
$result = ($data->status == 1) ? 'active' : 'disable'
<?php echo ($requestVars->_name == '') ? $redText : ''; ?>
$result = ($data->status == 1) ? 'active' : 'disable'