dpw43061 2018-12-15 20:20
浏览 31
已采纳

会徽如果在HTML代码中的条件并继续前面的div

$custom_column = '<div class="display: table-cell">';
                if(Auth::user()->role_id !==3){
                    '<div class="checkInfo green">
                        <label class="chkcontainer">
                            <input id="internalCheck'. $entery->id . '" onchange="internalOkFunction(this,' . $entery->id . ');return false;" type="checkbox" ' . $kycinternalok . ' >
                            <input id="hiddenId" type="hidden" value="'.$entery->id.'">
                            <span class="checkmark"></span>
                        </label>
                    </div>';
                }

<div class="display: table-cell"> not recognize when i set if statement after this. how can i run both <div class="display: table-cell"> and if()?

  • 写回答

1条回答 默认 最新

  • dongtong7990 2018-12-15 20:42
    关注

    Your data inside the condition block is not added to anything.

    You must concatenate to the variable.

    $custom_column = '<div class="display: table-cell">';
    if(Auth::user()->role_id !== 3){
        $custom_column .= '<div class="checkInfo green">
                               <label class="chkcontainer">
                                   <input id="internalCheck'. $entery->id . '" onchange="internalOkFunction(this,' . $entery->id . ');return false;" type="checkbox" ' . $kycinternalok . ' >
                                   <input id="hiddenId" type="hidden" value="'.$entery->id.'">
                                   <span class="checkmark"></span>
                               </label>
                           </div>';
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?