XF 2.0 Using the Addon Registry in a template IF statement?

Jaxel

Well-known member
Running \XF::repository('XF:AddOn')->getEnabledAddOns(); returns the following:
PHP:
array:5 [▼
  "EWR/Atendo" => 1300
  "EWR/Discord" => 1300
  "EWR/Porta" => 2012
  "EWR/Rio" => 2001
  "XF" => 2000170
]

I then want to use that data to run an IF statement in one of my templates. Unfortunately doing this:
Code:
<xf:if is="$addons.EWR/Rio">
Returns a syntax error... What would be the proper way to deal with this?
 
I believe you have to do an <xf:set> call and then use that variable for the array key.
 
Top Bottom