{/eq}" is enough."/> {/eq}" is enough.">

Home >PHP Framework >ThinkPHP >What to do if thinkphp eq fails?

What to do if thinkphp eq fails?

藏色散人
藏色散人Original
2022-12-05 11:31:451642browse

thinkphp eq failure solution: 1. Open the corresponding tp file; 2. Check the eq tag; 3. Modify the usage method to "{eq name="$vo.adminrole" value="0"} 4bf1b891f6c2dfb01a14225c80f3ce36b90dd5946f0946207856a8a37f441edf{/eq}" is enough.

What to do if thinkphp eq fails?

The operating environment of this tutorial: Windows 7 system, ThinkPHP version 5, Dell G3 computer.

thinkphp What should I do if eq fails?

The problem that eq does not work in tp5

1.The eq tag is used in thinkphp5.0, and the

<eq name="name" value="value">
相等
<else/>
不相等
</eq>
given in the official document

However, what I tested was of no use. I used the version of thinkphp5.0.20. After testing 5.0.15, it still works.

2. I checked on the Internet before about this and that problem, but it didn’t work. I don’t know if they have tested it themselves. Anyway, none of them can be used.

For example:

<eq name="vo.status" value="0">未激活</eq>
<eq name="vo.status" value="1">已激活</eq>

You will find that the one above is completely useless, or maybe their version is too excessive. Getting old.

3. Here is my final solution

{eq name="$vo.adminrole" value="0"}<td style="text-align: center">超级管理员</td>{/eq}
{eq name="$vo.adminrole" value="1"}<td style="text-align: center">教师管理员</td>{/eq}

$vo.adminrole is a variable in the volist loop list. In this way, refresh the page and it will take effect.

Recommended learning: "thinkPHP Video Tutorial"

The above is the detailed content of What to do if thinkphp eq fails?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn