Package

ViewHelpers

ViewHelper Documentation

v:if.client.isBrowser

Will be removed in 2.0

Please don't do user agent sniffing. This is bad practice.

Condition: Client's Browser

Condition ViewHelper which renders the then child if client's browser matches the browser argument

Examples

<!-- simple usage, content becomes then-child -->
<v:if.client.isBrowser browser="chrome">
    Thank you for using Google Chrome!
</v:if.client.isBrowser>
<!-- display a nice warning if not using Chrome -->
<v:if.client.isBrowser browser="chrome">
    <f:else>
        <div class="alert alert-info">
            <h2 class="alert-header">Please download Google Chrome</h2>
            <p>
                The particular system you are accessing uses features which
                only work in Google Chrome. For the best experience, download
                Chrome here:
                <a href="http://chrome.google.com/">http://chrome.google.com/</a>
            </p>
    </f:else>
</v:if.client.isBrowser>

Arguments

then anySimpleType

Value to be returned if the condition if met.

else anySimpleType

Value to be returned if the condition if not met.

browser string

ViewHelper Resources

Schema Resources