Skip to content

Instantly share code, notes, and snippets.

@starbuckit starbuckit/ImageController.php Secret
Last active Jan 17, 2016

Embed
What would you like to do?
<?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
You can’t perform that action at this time.