Custom DS and dependencies
This is an open discussion with 4 replies, filed under General.
Search
Did you use the following format, using the other datasources' output parameters? I found this worked for me in 2.3
.
public function __construct($env=NULL, $process_params=true){ parent::__construct($env, $process_params); $this->_dependencies = array('$ds-name.specific-output-param'); }
Yeah, that's how I have the __construct
set-up, but sadly it's not working for me. I think it may be because it's not a section based datasource, although I have tried extending the SectionDatasource
class...
If I'm not mistaken you should try using __processParametersInString
in your execute/grab function. pass the variables you require as string; and the $param_pool
as the env variable.
I assume it didn't work because you've extended the execute; probably if you renamed it to grab it might work not entirely sure.
My custom data source has its own execute
method, and it gets the output parameter from another datasource okay after I populated the dependencies array.
Create an account or sign in to comment.
I have a custom datasource that is based on Nick's ElasticSearch DS, that I require some output from other datasources on the page.
I've assumed that adding
$this->dependencies => array(...)
into the__construct
method will allow the DS to run after the others, and therefore give me the values in$this->_params
, alas, it does not.Does anyone know how I can get the parameters output by other datasources into this one?