有没有办法只查看来自 tinymce yii 的文本?

is there a way of viewing just text from tinymce yii?

每当我使用 yii 扩展 tinymce 时,在保存我的输入后它就会变成代码。例如,如果我输入 "sample text",它将显示为

<p>&nbsp;sample text</p>

我想知道是否可以从管理员那里以纯文本形式查看它....

有人能帮忙吗?

这是tinymce

当我保存它时,它看起来像这样,如果可能的话,这是我想改变的。

打印出来我使用这个代码:

<h3 class="header">     <?php
if (!$link = mysql_connect('localhost', 'root', '')) {
echo 'Could not connect to mysql';
exit;
}

if (!mysql_select_db('hygeia_master', $link)) {
echo 'Could not select database';
exit;
}

$sql    = 'SELECT title FROM about_histback order by datetime desc limit 1';
$result = mysql_query($sql, $link);

while ($row = mysql_fetch_assoc($result)) {
echo $row['title']."<br>";
}


?>
    <span class="header-line"></span> 
    </h3>
    </div>
    <div class="row-fluid">        

    <div class="span6">
    <?php
if (!$link = mysql_connect('localhost', 'root', '')) {
echo 'Could not connect to mysql';
exit;
}

if (!mysql_select_db('hygeia_master', $link)) {
echo 'Could not select database';
exit;
}

$sql    = 'SELECT historical_background FROM about_histback order by        datetime desc limit 1';
$result = mysql_query($sql, $link);

while ($row = mysql_fetch_assoc($result)) {
echo $row['historical_background']."<br>";
}


?>
</div>

所以显示会像这样

CDetailView 的每个属性都有一个类型参数:

$this->widget('zii.widgets.CDetailView', array(
    'data'=>$model,
    'attributes'=>array(
        // First example
        'fieldName:raw', // raw: the attribute value will not be changed at all.
        // Second example
        'fieldName:text', //text: the attribute value will be HTML-encoded when rendering.
        // Third example
        'fieldName:html', // html: the attribute value will be purified and then returned.
        // Fourth example
        array(
            'name' => 'fieldName',
            'type' => 'ntext', // ntext: the formatNtext method will be called to format the attribute value as a HTML-encoded plain text with newlines converted as the HTML <br /> or <p></p> tags.
        ),
    ),
));

您可以在 documentation 中找到更多详细信息,其他列表也支持输出类型。