How to access variables settings from within display_var_tag?
Hey Low - I'm adding LV support to my fieldtype, and am having trouble accessing my variable's settings within the fieldtype when using the low_variables:parse_variable
method.
Within display_var_field
, $this->settings['my_setting']
works as expected. But within display_var_tag
, it returns an undefined index.
I've tested this with EE 2.1.3 and the 2.1.4 and 2.1.5 betas.
Replies
Low 7 Jun 2011 07:23
Hey Derek,
You should be able to get to the settings using the second argument that is passed through to the display_var_tag method. It is called like this:
display_var_tag($var_data, $params, $tagdata)
The
$params
array should also contain any variable settings.Derek 7 Jun 2011 12:22
Thanks Low, that did it. It might be helpful if the docs included that bit of info.
Low 7 Jun 2011 12:24
Yeah, reflecting on it, this routine could be improved a bit.