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

Judgment status value syntax under thinkphp

高洛峰
高洛峰Original
2017-02-18 16:21:001165browse

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>

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

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

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!

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