Home  >  Article  >  Backend Development  >  php smart 模板怎么给input文本框赋值

php smart 模板怎么给input文本框赋值

WBOY
WBOYOriginal
2016-06-23 14:00:321168browse

我的项目用的CI框架和smart模板怎么给

<input type="text" id="teamId" name="teamId" value=""/>

这个文本框的value赋值。
   $teamId=1;   $this->cismarty->assign('teamId',$teamId);   $this->cismarty->display('teamInfo.html');



这个应该放在哪里


回复讨论(解决方案)

value=""

放到value里面

真可以放到里面吗 ,我开始放过了但是编辑器报错,这样运行没问题吗?

我刚才试过了方在value里面只有第一个文本框可以取到值其余的都取不到

<input type="text" id="Id" name="Id" value="<{$team.Id}>"/><input type="text" id="Code" name="Code" value="<{$team.Code}>"/><input type="text" id="Caption" name="Caption" value="<{$team.Caption}>"/>


$team['Id']=1;$team['Code']='001';$team['Caption']='aaaa';$this->cismarty->assign('team',$team);$this->cismarty->display('teamInfo.html');

只有第一个文本框有值其余都没有

没有这个符号

没有这个更不对了 value直接输出原字符串
1楼和2楼的是对的 我刚才 value 写错了 现在改过来了 但是编辑器显示为错误这个很纠结啊

<input type="text" id="Id" name="Id" value="<{$team.Id}>"/><input type="text" id="Code" name="Code" value="<{$team.Code}>"/><input type="text" id="Caption" name="Caption" value="<{$team.Caption}>"/>


这3行这样写zend studio编辑器显示为错误,这样看着很纠结啊。有没有别的处理方式

还有就是

 <a href="teaminfo?teamId=">

要将赋给这个地址怎么赋值

"/>
"/>
"/>

如果编辑器报错,则请关闭编辑器的 HTML 调试功能

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