public function profileAction() { $catalog = $this->forward()->dispatch('Catalog\\Controller\\Index', array('action' => 'getdata')); $this->layout()->catalog = $catalog; $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array('action' => 'getuser')); if ($getuser) { $this->layout('layout/bags'); $allcat = $this->forward()->dispatch('Catalog\\Controller\\Index', array('action' => 'getall')); $this->layout()->allcat = $allcat; $this->layout()->getuser = $getuser; $channel = $this->getChannelTable()->getname($getuser->channel_code); $this->layout()->channel = $channel; $form = new searchForm(); $request = $this->getRequest(); if ($request->isPost()) { $form->setData($request->getPost()); if ($form->isValid()) { $data = $form->getData(); // var_dump($data); $this->redirect()->toUrl(WEBPATH . '/search?keyword=' . $data['search'], true); } else { } } $select = new Select(); $page = $this->params()->fromRoute('page', 0) ? (int) $this->params()->fromRoute('page', 0) : 1; $session_user = new Container('user'); $user = $session_user->username; $paginator = $this->getMainTable()->fetchuser($user, true); // set the current page to what has been passed in query string, or to 1 if none set $paginator->setCurrentPageNumber((int) $page); // set the number of items per page to 10 $paginator->setItemCountPerPage(10); return new ViewModel(array('paginator' => $paginator)); } else { $this->layout('error/admin'); } }
<?php require_once './classes/searchForm.php'; $sf = new searchForm(); $form = $sf->get_search_form(); echo $form;