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
WBOYOriginal
2016-08-18 09:16:001224browse

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>

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

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