-
-
Save starbuckit/81ae3963513dde95be99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ImageController extends BaseController | |
{ | |
public function selectImageAlbumAction() | |
{ | |
Tag::setTitle('ImageEditor'); | |
parent::initialize(); | |
$album_id = $this->request->getPost('album_id'); | |
//$album_id = $this->request->getPut('album_id'); | |
$conditions = "album_id = :album_id:"; | |
$parameters = array( | |
"album_id" => "$album_id" | |
); | |
$album = AlbumLink::find( | |
array( | |
$conditions, | |
"bind" => $parameters | |
) | |
); | |
if (!$album) | |
{ | |
foreach ($album->getMessages() as $message) | |
{ | |
echo $message, "\n"; | |
} | |
$this->flash->error("Sorry, Album empty!"); | |
$this->response->redirect("album/index"); | |
} | |
else | |
{ | |
$currentPage = $this->request->getQuery('page', 'int'); | |
$paginator = new Phalcon\Paginator\Adapter\Model( | |
array( | |
"data" => $album, | |
"limit" => 10, | |
"page" => $currentPage | |
) | |
); | |
$page = $paginator->getPaginate(); | |
$this->view->setVar("page", $page); | |
//$this->view->setVar('album', $album); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment