hi all,
i have pagination set up on a set of data and all works fine. but i am
trying to add some ajax functionality to my page reloads and i've run across
a problem.
i have this code in my pagination.phtml
<?php if ($this->pageCount): ?>
<div class="paginationControl">
<!-- Previous page link -->
<?php if (isset($this->previous)): ?>
"javascript:ajaxReLoadCommentWall('<?php echo $this- id;?>','<?php echo
$this->previous;?>');">Previous |
<?php endif; ?>
<!-- Numbered page links -->
<?php foreach ($this->pagesInRange as $page): ?>
<?php if ($page != $this->current): ?>
"javascript:ajaxReLoadCommentWall('<?php echo $this- id;?>','<?php echo
$page;?>');"><?php echo $page; ?> |
<?php else: ?>
<?php echo $page; ?> |
<?php endif; ?>
<?php endforeach; ?>
<!-- Next page link -->
<?php if (isset($this->next)): ?>
"javascript:ajaxReLoadCommentWall('<?php echo $this- id;?>','<?php echo
$this->next;?>');">Next
<?php endif; ?>
</div>
<?php endif; ?>
my problem is that i have no idea how to assign the variable $this->id in
the controller or the model or anywhere for that matter!
my first thought was that there might be a way to attach some data to the
paginator within the model where it is setup.
this is the code i have there...
$postsAndUsers = PWallPosts::fetchPostsAndUsers($id);
$paginator = Zend_Paginator::factory($postsAndUsers);
$paginator->setItemCountPerPage($count);
$paginator->setCurrentPageNumber($page);
$paginator->setPageRange($pageRange);
Zend_Paginator::setDefaultScrollingStyle('Elastic');
Zend_View_Helper_PaginationControl::setDefaultViewPartial('proposal/pagination.phtml');
can i somehow attach the $id to paginator?
i also tried assigning this id to the view when i setup my controller. but
the view information is not available in the pagination.phtml because it's a
partial right?
anyway, i'm confused now and i'm sure there is a simple way to pass this id
into my phtml script somehow.. but i don't see it.. perhaps its time for bed
:)
any ideas?
--
View this message in context:
http://www.nabble.com/pagination-and-other-data-tp22395851p22395851.html
Sent from the Zend Framework mailing list archive at Nabble.com.