在用帝国ECMS,有时需要根据字段的值判断来模板中调用的内容。

最近在用帝国ECMS,有时需要根据字段的值判断来模板中调用的内容。
<?php
$shFieldname=$navinfor[Fieldname];
if ($shFieldname=="A") {
?>
值A代码
<?php
}elseif ($shFieldname=="B") {
?>
值B代码
<?php
}else{
?>
默认代码
<?php
}
?> Copyright Notice: This article is an original work. Copyright belongs to A君网志. Please contact the author for permission before reprinting.
Article URL: https://nipang.cn/ecms-elseif.html
If you have any questions or concerns about this article, feel free to leave a comment. I will try my best to respond as soon as possible.