牛骨文教育服务平台(让学习变的简单)
博文笔记

【html+css】fetch界面 smarty中 使用 if语句

创建时间:2015-06-12 投稿人: 浏览次数:621

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}
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。