Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

adodb-pager and Smarty
I am probably not assigning this correctly but here is the problem I am
having. First off, the pager works. I get the data and it creates a paging
table. That is . It just doesn't show up where I want it to on the
displayed page.

$pager = new ADODB_Pager($db, $rs);
$pager->Render($rows_per_page=15);
$page->assign('pagedata', $pager);

I then put {$pagedata} inside a <DIV> statement and that is where I want it
to show up. Instead the table shows up at the top of my page and the work
"Object" appears where I want the table to appear. I am guessing that I need
to do something a little more fancy than assign the results.

Robert

Report this thread to moderator Post Follow-up to this message
Old Post
Robert
12-21-04 09:00 PM


Re: adodb-pager and Smarty
* Robert <sigzero@gmail.com>:
> I am probably not assigning this correctly but here is the problem I am
> having. First off, the pager works. I get the data and it creates a paging
> table. That is . It just doesn't show up where I want it to on the
> displayed page.
>
> $pager = new ADODB_Pager($db, $rs);
> $pager->Render($rows_per_page=15);
> $page->assign('pagedata', $pager);
>
> I then put {$pagedata} inside a <DIV> statement and that is where I want i
t
> to show up. Instead the table shows up at the top of my page and the work
> "Object" appears where I want the table to appear. I am guessing that I ne
ed
> to do something a little more fancy than assign the results.

I am not familiar with ADODB_Pager, but from your description of it and
the output (and how the PEAR::Pager class works), it looks like you
probably need to do the following:

$pager = new ADODB_Pager($db, $rs);
$pagedata = $pager->Render($rows_per_page=15);
$page->assign('pagedata', $pagedata);

Note: I am capturing the return value from Render(), and assigning that
to the template instead of the pager object itself.

If this is not how it works, another possiblity is that in your template
you'll need to build the pager:

{if $pagedata}
<div class="pager">
{$pager->firstPage} ... etc.
</div>
{/if}

If all else fails, do a print_r on $pager and/or the return value from
Render() to see what it looks like, and build your template accordingly.

--
Matthew Weier O'Phinney           | mailto:matthew@garden.org
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

Report this thread to moderator Post Follow-up to this message
Old Post
Matthew Weier O'Phinney
12-21-04 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Smarty Templates archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:02 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.