MMO-DEV WEB Functions
Assets
asset()
Generates a URL to a static file with cache busting:
asset()
{{ asset('css/style.css') }}
{# /css/style.css?v=a1b2c3 #}
{{ asset('images/logo.png') }}
Modules
mw_module_enabled()
Checks whether a module is enabled:
mw_module_enabled()
{% if mw_module_enabled('market') %}
{% include '@site/partials/market-widget.html.twig' %}
{% endif %}
mw_module_exists()
Checks whether a module is installed:
mw_module_exists()
{% if mw_module_exists('forum') %}
{# Module is installed #}
{% endif %}
Forms and Security
mw_render_formbuilder()
Renders a form created via FormBuilder:
mw_render_formbuilder()
{{ mw_render_formbuilder(form)|raw }}
mw_captcha()
Outputs a CAPTCHA:
mw_captcha()
{{ mw_captcha()|raw }}
Analytics
mw_analytics()
Outputs analytics code:
mw_analytics()
{{ mw_analytics()|raw }}
mw_gtm_noscript()
Outputs the noscript portion of Google Tag Manager:
mw_gtm_noscript()
{{ mw_gtm_noscript()|raw }}
Users
mw_is_vip_member()
Checks whether the current user has an active VIP membership:
mw_is_vip_member()
{% if mw_is_vip_member() %}
<span class="badge bg-warning">VIP</span>
{% endif %}
Utilities
mw_percentage()
Calculates a percentage:
mw_percentage()
{{ mw_percentage(current, total) }}%
{# For example: 75% #}
Game Functions
mw_crest()
Displays a clan or alliance crest:
mw_crest()
{{ mw_crest(clan.crest_id)|raw }}
mw_item()
Displays a game item with a tooltip:
mw_item()
{{ mw_item(item_id)|raw }}
mw_item_icon()
Displays an item icon:
mw_item_icon()
{{ mw_item_icon(item_id)|raw }}
mw_aion_exp_to_level()
Converts Aion experience to level:
mw_aion_exp_to_level()
Level: {{ mw_aion_exp_to_level(character.exp) }}