TPWhy does this if judgment display nothing?

WBOY
Release: 2023-03-02 11:54:01
Original
1143 people have browsed it

既不显示aaa也不显示bbb这是为什么?

<code><if condition="isset(session('name'))">
aaa
<else />
bbb
</if></code>
Copy after login
Copy after login

回复内容:

既不显示aaa也不显示bbb这是为什么?

<code><if condition="isset(session('name'))">
aaa
<else />
bbb
</if></code>
Copy after login
Copy after login

把session('name")换成$Think.session.name或者Think.session.name试一试。

可能是模板缓存,删缓存再跑一次

判断的等号是双 == 不是单等 =

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!