[Solar-talk] config inheritance in helpers

Paul M Jones pmjones at solarphp.com
Mon Jul 31 07:20:55 PDT 2006


On Jul 27, 2006, at 6:06 AM, Rodrigo Moraes wrote:

> The idea behind the Pager Helper Family is to have a common set of
> options for pager adapters and decorators, so you can change the pager
> configuration and have a different amount of items in the list, a
> different pager logic or different HTML markups without calling a
> different helper. So the 'config' part is one of the most important
> things (as in Solar ;-), and I tried to follow the same 'config
> inheritance' Solar idea for the helpers. The current form is this:
>
> $config = array(
>     'adapter' => 'Simple',
>     'options' => array('delta' => 5),

For future reference, the "standard" when using an adapter is, if you  
need to pass configs to the adapter, you use a key of 'config'.  E.g.:

     array('adapter' => 'simple', 'config' => array('delta' => 5)


> 'options' is related to the adapter 'Simple' and 'display' are the
> options for the decorator 'PagerList'.

I think you've said something like this in the past few days, but:   
if there's a way to do this with either adapters or decorators (not  
both) then that would be better.



--

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

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

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




More information about the solar-talk mailing list