[Solar-talk] pager + controller + model + view

Paul M Jones pmjones at ciaweb.net
Wed Jul 11 09:49:30 CDT 2007


On Jul 11, 2007, at 9:41 AM, Rodrigo Moraes wrote:

> 2007/7/11, Paul M Jones:
>> Paging is a common-enough operation that it might be OK to make
>> allowances for it in Solar_App_Base.  Good idea Rodrigo.  :-)
>>
>> Now for some feedback:
>>
>> > App_Base pager property:
>> > * $layout_pager: array with pager values ('page', 'paging',  
>> 'count')
>>
>> Would this necessarily be a "layout" element?  It seems to me that
>> paging is a function of the view, not of the layout.  We have
>> $controller and $action, perhaps adding $pager is in line with that.
>> (Although I can see an argument for the pager as part of the
>> navigation system.)
>
> I thought this later, after I created the var and sent this e-mail.
> Your arguments make sense, and calling it just $pager would be better
> for me too.
>
>> Also, I think instead of 'count' it ought to be 'total' and 'pages',
>> so that it maps more closely to the fetchCount() array return.
>>
>> That would end up looking something like:
>>
>>      $this->pager = array(
>>          'total'  => 100,
>>          'pages'  => 20,
>>          'page'   => 1,
>>          'paging' => 5,
>>      );
>
> Ah, also I changed it later to follow fetchCount() keys. The pager
> helper now uses exactly these keys you mentioned. :)

Good man, good thinking!  :-)


>
>> > App_Base pager method:
>> > * _setPager():
>>
>> I don't think I'm ready to commit to a method for this in
>> Solar_App_Base yet ...
>
> You don't need! It can be an action helper. =)
>
>> > The_setPager() method is defined in this class:
>> > [1] http://dev.tipos.org/browser/trunk/Tipos/App/Base.php
>>
>> ... and I don't see it there anyway; did I miss it?
>
> Aha, here is the helper:
>
>    http://dev.tipos.org/browser/trunk/Tipos/Controller/Helper/ 
> SetPager.php

Ah, and now we get back to page-controller helpers, I see how you try  
to lead me around ... ;-)




--

Paul M. Jones  <http://paul-m-jones.com>

Solar: Simple Object Library and Application Repository
for PHP5.  <http://solarphp.com>

Join the Solar community wiki!  <http://solarphp.org>

Savant: The simple, elegant, and powerful solution for
templates in PHP.  <http://phpsavant.com>




More information about the Solar-talk mailing list