<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                模板是數據處理后的最終展現平臺,也是用戶操作與感知的入口。Album模塊使用的模板有4個:index.phtml , add.phtml , edit.phtml , delete.phtml , paginator.phtml 分別 列表、添加、修改、刪除、分頁導航 ### 7.8.1 列表模板 index.phtml 添加文件:/module/Album/view/album/album/index.phtml,內容如下: ~~~ <table> <tr> <th><?php echo $this->translate("Title") ?></th> <th><?php echo $this->translate("Artist") ?></th> <th><a href="<?php echo $this->url('album', array('action' => 'add')); ?>"><?php echo $this->translate("Add new album") ?></a></th> </tr> <?php foreach ($paginator as $album) : ?> <tr> <td><?php echo $this->escapeHtml($album->title); ?></td> <td><?php echo $this->escapeHtml($album->artist); ?></td> <td> <a href="<?php echo $this->url('album', array('action' => 'edit', 'id' => $album->id)); ?>"><?php echo $this->translate("Edit") ?></a> <a href="<?php echo $this->url('album', array('action' => 'delete', 'id' => $album->id)); ?>"><?php echo $this->translate("Delete") ?></a> </td> </tr> <?php endforeach; ?> </table> <?php echo $this->paginationControl($this->paginator,'sliding',array('partial/paginator.phtml','Album'),array('route'=>'album')); ?> ~~~ ### 7.8.2 列表模板 add.phtml 添加文件:/module/Album/view/album/album/add.phtml,內容如下: ~~~ <?php $form = $this->form; $form->setAttribute('action',$this->url('album',array('action'=>'add'))); echo $this->form()->openTag($form); echo $this->formCollection($this->form); echo $this->form()->closeTag(); ?> ~~~ ### 7.8.3 列表模板 edit.phtml 添加文件:/module/Album/view/album/album/edit.phtml,內容如下: ~~~ <?php $form = $this->form; $form->setAttribute('action',$this->url('album',array('action'=>'edit','id'=>$this->id))); echo $this->form()->openTag($form); echo $this->formCollection($this->form); echo $this->form()->closeTag(); ?> ~~~ ### 7.8.4 列表模板 delete.phtml 添加文件:/module/Album/view/album/album/delete.phtml,內容如下: ~~~ <?php $title = 'Delete album'; $this->headTitle($title); ?> <h1><?php echo $this->escapeHtml($title); ?></h1> <p>Are you sure that you want to delete '<?php echo $this->escapeHtml($album->title); ?>' by '<?php echo $this->escapeHtml($album->artist); ?>'? </p> <?php $url = $this->url('album', array( 'action' => 'delete', 'id' => $this->id, )); ?> <form action="<?php echo $url; ?>" method="post"> <div> <input type="hidden" name="id" value="<?php echo (int) $album->id; ?>" /> <input type="submit" name="del" value="Yes" /> <input type="submit" name="del" value="No" /> </div> </form> ~~~ ### 7.8.5 列表模板 paginator.phtml 添加文件:/module/Album/view/partial/paginator.phtml,內容如下: ~~~ <?php if ($this->pageCount): ?> <div class="pagination pagination-centered"> <ul> <!-- Previous page link --> <?php if (isset($this->previous)): ?> <li> <a href="<?php echo $this->url($this->route); ?>?page=<?php echo $this->previous;?>"><<</a> </li> <?php else: ?> <li class="disabled"> <a href="#"> << </a> </li> <?php endif; ?> <!-- Numbered page links --> <?php foreach ($this->pagesInRange as $page): ?> <?php if ($page != $this->current): ?> <li> <a href="<?php echo $this->url($this->route); ?>?page=<?php echo $page; ?>"> <?php echo $page; ?> </a> </li> <?php else: ?> <li class="active"> <a href="#"><?php echo $page; ?></a> </li> <?php endif; ?> <?php endforeach; ?> <!-- Next page link --> <?php if (isset($this->next)): ?> <li> <a href="<?php echo $this->url($this->route); ?>?page=<?php echo $this->next; ?>"> >> </a> </li> <?php else: ?> <li class="disabled"> <a href="#"> >> </a> </li> <?php endif; ?> </ul> </div> <?php endif; ?> ~~~ 經過以上的準備工作,接下可以通過 http://localhost/album 來打開album 列表的,打開的頁面結果如下所示: ~~~ header Title Artist Add new album First album artist01 EditDelete Second album artist02 EditDelete Third album artist03 EditDelete fourth album artist04 EditDelete Fifth album artist05 EditDelete << 1 2 >> footer ~~~ 點擊 列表上面的Add new album 可以進行 album 添加,頁面結果如下所示: ~~~ header 窗體頂端 Title窗體底端 Artist footer ~~~ 點擊列表右邊的 Edit 可以對album 的信息進行修改,頁面結果如下所示: ~~~ header 窗體頂端 Title窗體底端 Artist footer ~~~ 點擊列表右邊的 Delete 可以對album 記錄進行刪除,確認刪除頁面如下所示: ~~~ header Delete album Are you sure that you want to delete 'First album' by 'artist01'? 窗體頂端 窗體底端 footer ~~~ 到此已經完成了對整個Album模塊的的構造及功能的實現,此實例雖然沒有實際的應用意義,但他已經完整的展示了在ZF2一個完整模塊的存在形式,以及與其他模塊同時并存且同時協同工作的具體應用,在進行具體項目開發的時候可以借鑒或參考此例以便開發出不同功能的模塊,使用項目模塊能夠共同協同工作。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看