Php联系人表单主题字段

Php联系人表单主题字段,php,forms,joomla-k2,Php,Forms,Joomla K2,我的contact.php文件中有以下内容: '.JText::_('PLG_LABEL_NAME').' <input type="text" name="name" id="name" value="'.$_POST['name'].'" /> <br /> <br /> '.JText::_('PLG_LABEL_EMAIL').' <input type="text" name="ema

我的contact.php文件中有以下内容:

'.JText::_('PLG_LABEL_NAME').'
      <input type="text" name="name" id="name" value="'.$_POST['name'].'" />
      <br />
      <br />
      '.JText::_('PLG_LABEL_EMAIL').'
      <input type="text" name="email" id="email" value="'.$_POST['email'].'" />
      <br />
      <br />
      '.JText::_('PLG_LABEL_SUBJECT').'
      <input type="text" name="subject" id="subject" value="'.$_POST['subject'].'" />
      <br />
      <br />
”.JText::((“PLG_标签_名称”)。'


“.JText:::”(“PLG标签电子邮件”)。”

“.JText:::”(PLG标签主题)。”

这两个代码中的哪一个或在哪里添加这些代码

<?php if($this->item->params->get('itemTitle')): ?>
<?php echo $this->item->title; ?>

顺便说一句,先谢谢你


它在范围文件之外。包含该项目的文件位于item.php中,它有此行来获取项目标题并将其显示为

<?php if($this->item->params->get('itemTitle')): ?>
      <!-- Item title -->
      <h2 class="itemTitle">
        <?php echo $this->item->title; ?>

像这样吗

$html .= '<label for="contact_subject">';
$html .= '&nbsp;'. JText::_( 'Subject' ).':';
if ($this->item->params->get('itemTitle')) $html .= $this->item->title;
$html .= '</label>';
$html.='';
$html.=''。JText::(“主题”)。:;
如果($this->item->params->get($itemTitle'))$html.=$this->item->title;
$html.='';

哦,对不起,如果(!$\u post[“subject”]{$errori.=JText::(('PLG\u ERROR\u NO\u subject')。“
”;}和'.JText::(('PLG\u LABEL\u subject')。
对不起,我不太明白,你能在适当的代码部分用相关代码编辑问题吗?那么你希望
$this->item->title
在HTML中的什么位置出现?如果可能,我希望它出现在主题输入字段中。谢谢你,就这样。我想用当前项目标题填充主题输入字段。