bootstrap模型显示相同的内容

时间:2015-09-04 15:48:24

标签: php twitter-bootstrap bootstrap-modal simplemodal

Bootstrap模型显示相同的内容,当使用jplist使用php,sql。

获取数据时

Example Link

Source Files

Link tried

        private function getHTML($item){

        $html = "";

        $html .= "<div class='list-item box'>"; 
        $html .= "  <div class='img left'>";
        $html .= "      <img src='" . $item['image'] . "' alt='' title=''/>";
        $html .= "  </div>";

        $html .= "<div class='dropdown'>";
        $html .= "<button class='btn btn-primary btn-xs dropdown-toggle' type='button' id='dropdownMenu1' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>Details</button>";
        $html .= "<ul class='dropdown-menu' aria-labelledby='dropdownMenu1'>";
        $html .= "<p class='title'>" . $item['title'] . "</p>";
        $html .= "<p class='likes'>" . $item['likes'] . "</p>";
        $html .= "</ul>";
        $html .= "</div>";

        $html .= "<button type='button' class='btn btn-primary btn-lg' data-toggle='modal' data-target='#myModal'>Launch demo modal</button>";
        $html .= "<div class='modal fade' id='myModal' tabindex='-1' role='dialog' aria-labelledby='myModalLabel'>";
        $html .= "<div class='modal-dialog' role='document'>";
        $html .= "<div class='modal-content'>";
        $html .= "<div class='modal-header'>";
        $html .= "<h4 class='modal-title' id='myModalLabel'>Modal title</h4>";
        $html .= "<p class='title'>" . $item['title'] . "</p>";
        $html .= "<p class='likes'>" . $item['likes'] . "</p>";
        $html .= "</div>";
        $html .= "</div>";
        $html .= "</div>";
        $html .= "</div>";


        $html .= "  <div class='block right'>";
        $html .= "      <p class='title'>" . $item['title'] . "</p>";
        $html .= "      <p class='desc'>" . $item['description'] . "</p>";
        $html .= "      <p class='like'>" . $item['likes'] . " Likes</p>";
        $html .= "      <p class='theme'>" . $item['keyword1'] . ", " . $item['keyword2'] . "</p>";
        $html .= "  </div>";
        $html .= "</div>";

        return $html;
    }

它将点击的链接存储在模态的数据中,我不知道如何获取新数据或在获取之前删除旧数据。

0 个答案:

没有答案