我有一个关于FormTools (www.formtools.org)的问题,也许你们中的一些人遇到了这个问题。我需要在表单中自动输入用户名。实际上,我使用提交预解析器模块来获取关于用户名的值
if (!empty($_POST["username"])) {
$_POST["FormTools\Sessions::get("account.username")"] = true;
} 接下来,我使用了自定义字段模块,我在其中定义了如下内容
<input type="text" name="{$NAME}" value="<?php echo $username ?>" class="{$size}{if $highlight} {$highlight}{/if}" id="username"
{if $maxlength}maxlength="{$maxlength}"{/if} />
{if $comments}
<div class="cf_field_comments">{$comments}</div>
{/if}但是原因看起来像这样

也许你们中的一些人可以帮助我如何从
FormTools\Sessions::get("account.username")至
<input type="text" value="**HERE">发布于 2019-02-21 20:32:23
问题解决了!原因是在config.php $g_use_smarty_bc = true;中添加,然后在自定义字段模块中添加
{php}
$username = FormTools\Sessions::get("account.username");
{/php}
<input readonly type="text" name="{$NAME}" value="{php}echo $username{/php}" class="" id="username"
{if $maxlength}maxlength="{$maxlength}"{/if} />
{if $comments}
{$comments}
{/if}https://stackoverflow.com/questions/54780297
复制相似问题