Home > Backend Development > PHP Tutorial > YII表单输出问题

YII表单输出问题

WBOY
Release: 2016-06-06 20:40:41
Original
1075 people have browsed it

先上我的模型验证:

<code>[
    ['content','title','excerpt'],
    'filter',
    'filter' => 'htmlspecialchars',
    'on' => ['create','modify']
],
</code>
Copy after login
Copy after login

展示文章的时候是没有问题的,但是编辑的时候
YII表单输出问题
ps:我展示的时候也没有进行htmlspecialchars_decode,直接:
= $article['content'] ?>
没有问题~
就想问下在yii的表单里应该怎么做?
表单代码:
= $form->field($model, 'content')->textarea(['rows' => 6,'style'=>'resize:vertical','id'=>'editor']) ?>

回复内容:

先上我的模型验证:

<code>[
    ['content','title','excerpt'],
    'filter',
    'filter' => 'htmlspecialchars',
    'on' => ['create','modify']
],
</code>
Copy after login
Copy after login

展示文章的时候是没有问题的,但是编辑的时候
YII表单输出问题
ps:我展示的时候也没有进行htmlspecialchars_decode,直接:
= $article['content'] ?>
没有问题~
就想问下在yii的表单里应该怎么做?
表单代码:
= $form->field($model, 'content')->textarea(['rows' => 6,'style'=>'resize:vertical','id'=>'editor']) ?>

Html::decode($var) ?

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