I'm extending the Channel module entries()
method in my custom plugin and am trying to figure out how to include the search:
parameter. I get that the search parameters are an array accessed via ee()->TMPL->search_fields
, but I can't figure out how to pass that data to the method. Here's what I have (simplified):
public function entries()
{
$channel = ee()->TMPL->fetch_param('channel');
$search_fields = ee()->TMPL->search_fields;
return $this->_channel_entries($channel, $search_fields);
}
private function _channel_entries( $channel='', $search_fields=array() )
{
ee()->TMPL->tagparams = array(
'channel' = $channel,
'disable' = 'member_data|pagination|categories'
);
ee()->TMPL->search_fields = $search_fields;
if (! class_exists('channel'))
{
require_once PATH_MOD.'channel/mod.channel.php';
}
$channel = new Channel;
return $channel->entries();
}
How do I give the entries()
method access to the search_fields
data?