Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- У меня проблема с методом.
- 1)<button type="button" class="btn btn-default" onclick="window.history.back();">Отменить</button>
- При нажатии кнопки в форме в Edit.html
- https://github.com/pr-of-it/t4-standard-app/blob/gallery/protected/Modules/Gallery/Templates/Admin/Edit.html
- Запрашивается повторная отправка форму, и естественно никакого id в метод не передается , потому выдает ошибку о неверном SQL запросе.
- 2) Стыдно, но не понимаю, как передать в пейджере тот же id при переходе по ссылкам страниц
- <div class="row">{{widget('pager', {'total': itemsCount, 'size': pageSize, 'active': activePage, 'url': '/admin/gallery/photo?page=%d&id=что тут ставить?'})}}</div>
- https://github.com/pr-of-it/t4-standard-app/blob/gallery/protected/Modules/Gallery/Templates/Admin/Photo.html
- public function actionPhoto($id = null,$page = 1)
- {
- if($id == null){
- $id = $this->app->request->post->parent;
- }
- $album = Album::findByColumn('__id', $id);
- $this->data->itemsCount= Album::countAll();
- $this->data->pageSize = self::PAGE_SIZE;
- $this->data->activePage = $page;
- $this->data->albums = Album::findAllByQuery('SELECT __id, title FROM albums WHERE __lft >'.$album->__lft.' AND __rgt <'.$album->__rgt);
- $this->data->photos = Photo::findAllByColumn('__album_id', $id, [
- 'order' => 'published DESC',
- 'offset' => ($page - 1) * self::PAGE_SIZE,
- 'limit' => self::PAGE_SIZE
- ]);
- $this->data->item = Album::findByColumn('__id', $id);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement