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

来源:互联网 发布:红蜘蛛软件是什么 编辑:程序博客网 时间:2024/05/16 08:42

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}
0 0
原创粉丝点击