【html+css】fetch界面 smarty中 使用 if语句
action中:
public function cinfoAction()
{
$userid = $this->getParam("userid");//表示user_id
$sellerid = Cookie::getSingleSellerCookies("seller_id");
$custominfo= new CustomInfo();
$data=$custominfo->getcInfo($sellerid,$userid);
$this->view->assign("data",$data);
$htmlinfo=$this->view->fetch("crm_custom/custom_info/common/custom_info_in/cinfo.phtml");
$msg=array("erruserid"=>$userid,"errsellerid"=>$sellerid,"html"=>$htmlinfo);
echo json_encode($msg);
}
html:
{if $data.birth_year==""}
<td><input type="text" value="" class="Wdate w150" onfocus="WdatePicker({literal}{skin:"whyGreen", dateFmt:"yyyy-MM-dd", readOnly:true}{/literal});" style="height:auto;">
</td>
{else}
<td>
<input type="text" value={$data.birth_year} class="Wdate w150" onfocus="WdatePicker({literal}{skin:"whyGreen", dateFmt:"yyyy-MM-dd", readOnly:true}{/literal});" style="height:auto;">
</td>
{/if}
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。