public function indexAction() { $adapter = new MyAdapter("admin", "qwerty"); $result = $adapter->authenticate(); $code = $result->getCode(); $identity = $result->getIdentity(); return new ViewModel(['code' => $code, 'identity' => $identity]); }
public function indexAction() { $adapter = new MyAdapter("admin2", "qwerty"); $result = $adapter->authenticate(); $code = $result->getCode(); $identity = $result->getIdentity(); if ($result->isValid()) { return new ViewModel(array('pages' => $this->getPageTable()->fetchAll())); } else { return new ViewModel(['messadge' => 'Типа форма']); } }