3 namespace Galerie\Controller;
5 use Zend\Mvc\Controller\AbstractActionController;
6 use Zend\View\Model\ViewModel;
8 class IndexController extends AbstractActionController
11 private $_galerieTable;
12 private $_galerieInfoTable;
15 private function _getGalerieTable()
17 if (!$this->_galerieTable) {
18 $sm = $this->getServiceLocator();
19 $this->_galerieTable = $sm->get('Galerie\Model\GalerieTable');
21 return $this->_galerieTable;
24 private function _getGalerieInfoTable()
26 if (!$this->_galerieInfoTable) {
27 $sm = $this->getServiceLocator();
28 $this->_galerieInfoTable = $sm->get('Galerie\Model\GalerieInfoTable');
30 return $this->_galerieInfoTable;
34 public function indexAction()
36 return new ViewModel(array(
37 'Galerie_all' => $this->_getGalerieTable()->all(),
38 'Galerie_one' => $this->_getGalerieTable()->get(1),
39 'GalerieInfo_all' => $this->_getGalerieInfoTable()->select(),
40 'GalerieInfo_one' => $this->_getGalerieInfoTable()->select(array('gallery.id' => 1))->current(),
41 'GalerieInfo_usr' => $this->_getGalerieInfoTable()->select(array('gallery.id_user' => 1)),
45 public function editAction()
50 public function delAction()
55 public function viewAction()