Home > Backend Development > PHP Tutorial > Think how do you masters smarty parse the HTML of PHP data into entities?

Think how do you masters smarty parse the HTML of PHP data into entities?

WBOY
Release: 2016-08-18 09:16:00
Original
1223 people have browsed it

For example, I have something like this in the database: <b>aaaaaa</b>;
I take out the data and use smarty to achieve code separation, but when I put it on smarty, the data is parsed according to html, and my The expectation is to display the data as it is, but I can’t find the answer on the search engine. I have been using laravel’s blade template before, so when I encounter similar problems, I come to ask the seniors who use smarty for advice

Reply content:

For example, I have something like this in the database: <b>aaaaaa</b>;
I take out the data and use smarty to achieve code separation, but when I put it on smarty, the data is parsed according to html, and my The expectation is to display the data as it is, but I can’t find the answer on the search engine. I have been using laravel’s blade template before, so when I encounter similar problems, I come to ask the seniors who use smarty for advice

<code> {$output | escape} </code>
Copy after login

In smarty, the output content is followed by escape to escape html tags.

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