예제 #1
0
 public function indexAction()
 {
     $this->settingsForm->setData($this->settingsManager->getAll());
     if ($this->getRequest()->isPost()) {
         $this->settingsForm->setData($this->getRequest()->getPost());
         if ($this->settingsForm->isValid()) {
             $data = $this->settingsForm->getData();
             $this->settingsManager->set('application_title', $data['application_title']);
             $this->settingsManager->flush();
             $this->flashMessenger()->addSuccessMessage('The settings have been saved.');
             return $this->redirect()->toRoute('admin/system/settings');
         }
     }
     return new ViewModel(['settingsForm' => $this->settingsForm]);
 }
예제 #2
0
 public function fetchAll($params = array())
 {
     $adapter = new ArrayAdapter($this->settingManager->getAll());
     return new SettingCollection($adapter);
 }