Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Update for latest forms work
Browse files Browse the repository at this point in the history
  • Loading branch information
akrabat committed May 15, 2012
1 parent 3a4f6ac commit 9077518
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions module/Album/src/Album/Controller/AlbumController.php
Expand Up @@ -29,11 +29,12 @@ public function addAction()

$request = $this->getRequest();
if ($request->isPost()) {
$album = new Album;
$album = new Album();
$form->setInputFilter($album->getInputFilter());
$form->bind($album);
$form->setData($request->post());
if ($form->isValid()) {

$album->populate($form->getData());
$this->albumTable->saveAlbum($album);

// Redirect to list of albums
Expand All @@ -55,12 +56,13 @@ public function editAction()
$album = $this->albumTable->getAlbum($id);

$form = new AlbumForm();
$form->setBindOnValidate(false);
$form->bind($album);
$form->get('submit')->setAttribute('label', 'Edit');
if ($request->isPost()) {
$form->setData($request->post());
if ($form->isValid()) {
LDBG($album);exit;
$form->bindValues();
$this->albumTable->saveAlbum($album);

// Redirect to list of albums
Expand Down
2 changes: 1 addition & 1 deletion module/Album/src/Album/Model/Album.php
Expand Up @@ -84,6 +84,6 @@ public function getInputFilter()
$this->inputFilter = $inputFilter;
}

return $inputFilter;
return $this->inputFilter;
}
}

0 comments on commit 9077518

Please sign in to comment.