Home > PHP Framework > ThinkPHP > body text

What to do if thinkphp eq fails?

藏色散人
Release: 2022-12-05 11:31:45
Original
1609 people have browsed it

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"} {/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>
Copy after login
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>
Copy after login

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}
Copy after login

$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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template