distill icon indicating copy to clipboard operation
distill copied to clipboard

Allow for settings to be passed when calling setAllFields

Open tappleby opened this issue 9 years ago • 2 comments

It would be useful to pass field settings when using setAllFields. The ability to exclude certain fields would also be handy as well.

tappleby avatar Jun 30 '15 14:06 tappleby

@tappleby good ideas!

Excluding certain fields is pretty easy to do. Passing field settings into processors is a bit more complicated. I've thought of a few different ways to do that. The one I like most is something similar to this:

$distiller->setAllFields(array(
  'my_field_name' => array(
    'link' => TRUE,
  ),
));

The first parameter would take an array of subarrays keyed by field name. I'll see if I have time to build this out next week.

patrickocoffeyo avatar Jul 31 '15 15:07 patrickocoffeyo

Thats pretty much what I ended up doing here - https://github.com/tappleby/distill/compare/09aa7675db091f15872d36ac87a32033d34c9a46...tappleby:b5f7de8ec6fa2357caa4b244ea8aaa8554d0f3da

I also added an argument to restrict the fields.

tappleby avatar Jul 31 '15 16:07 tappleby