Home > Backend Development > PHP Tutorial > Judgment status value syntax under thinkphp

Judgment status value syntax under thinkphp

高洛峰
Release: 2023-03-05 20:14:01
Original
1168 people have browsed it

In the thinkphp framework we often use status value judgment: but writing this way will cause syntax errors.

<p>
    <if condition="{$res.status} eq &#39;0&#39;">测试</if></p>
Copy after login

2. Correct writing: Because the "." syntax cannot be used in thinkphp

<if condition="$res[&#39;status&#39;] eq 0">测试</if>
Copy after login

The

f tag already contains PHP parsing. If you write {} tag parsing in it, an error that does not conform to PHP syntax will be reported.
For more related articles about judging status value syntax under thinkphp, please pay attention to 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