<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                添加文件:`/module/Album/src/Controller/AlbumController.php` 具體內容如下: ~~~ namespace Album\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; use Album\Model\Album; use Album\Form\AlbumForm; class AlbumController extends AbstractActionController{ protected $albumTalbe; public function indexAction(){ $paginator = $this->getAlbumTalbe()->fetchAll(true); $paginator->setCurrentPageNumber((int)$this->params()->fromQuery('page',1)); $paginator->setItemCountPerPage(5); return new ViewModel(array('paginator'=>$paginator)); } public function addAction(){ $form = new AlbumForm(); $form->get('submit')->setValue('Add'); $request = $this->getRequest(); if($request->isPost()){ $album = new Album(); $form->setInputFilter($album->getInputFilter()); $form->setData($request->getPost()); if($form->isValid()){ $album->exchangeArray($form->getData()); $this->getAlbumTalbe()->saveAlbum($album); return $this->redirect()->toRoute('album'); } } return array('form'=>$form); } public function editAction(){ $id = (Int) $this->params()->fromRoute('id',0); if(!$id){ return $this->redirect()->toRoute('album',array('action'=>'add')); } try{ $album = $this->getAlbumTalbe()->getAlbum($id); }catch(\Exception $e){ return $this->redirect()->toRoute('album',array('action'=>'index')); } $form = new AlbumForm(); $form->bind($album); $form->get('submit')->setAttribute('value', 'Edit'); $request = $this->getRequest(); if($request->isPost()){ $form->setInputFilter($album->getInputFilter()); $form->setData($request->getPost()); if($form->isValid()){ $this->getAlbumTalbe()->saveAlbum($form->getData()); return $this->redirect()->toRoute('album'); } } return array('id'=>$id,'form'=>$form); } public function deleteAction(){ $id = (Int) $this->params()->fromRoute('id',0); if(!$id){ return $this->redirect()->toRoute('album'); } $request = $this->getRequest(); if($request->isPost()){ $del = $request->getPost('del','No'); if($del=='Yes'){ $id = (Int)$request->getPost('id'); $this->getAlbumTalbe()->deleteAlbum($id); } return $this->redirect()->toRoute('album'); } return array('id'=>$id,'album'=>$this->getAlbumTalbe()->getAlbum($id)); } public function getAlbumTalbe(){ if(!$this->albumTalbe){ $sm = $this->getServiceLocator(); $this->albumTalbe = $sm->get('Album\Model\AlbumTable'); } return $this->albumTalbe; } } ~~~ 代碼解釋: public function indexAction(){} album默認訪問action,也是album列表action public function addAction(){} 添加album 的 action public function editAction(){} 編輯修改album的action public function deleteAction(){} 刪除album 的action lpublic function getAlbumTalbe(){} 設置數據庫網關
                  <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>

                              哎呀哎呀视频在线观看