View on
MetaCPAN
Barry King > Apache-Wyrd > Apache::Wyrd::Version

Download:
Apache-Wyrd-0.98.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.98   Source  

NAME ^

Apache::Wyrd::Version - Designate a block for certain classes of browsers

SYNOPSIS ^

  <BASENAME::BrowserSwitch>
    <BASENAME::Version test="IE">
      .. version for MSIE ..
    </BASENAME::VERSION>
    <BASENAME::Version tests="Gecko, Safari">
      .. version for NS & Safari ..
    </BASENAME::VERSION>
    <BASENAME::Version test="Lynx">
      .. version for Lynx ..
    </BASENAME::VERSION>
    <BASENAME::Version test="Google" matchstring="Googlebot">
      .. version for Google ..
    </BASENAME::VERSION>
  </BASENAME::BrowserSwitch>

DESCRIPTION ^

A sub-wyrd of BrowserSwitch which delineates a version of a section of HTML which must be rendered differently for different browsers.

HTML ATTRIBUTES

test

The browser type the enclosed HTML is targeted to. Builtin tests are ie, gecko, safari, and lynx. Case is not sensitive.

tests

An alias for test.

matchstring

If you are targeting one of the other browsers, this attribute provides a substring which will be checked against the User-Agent string of the browser.

PERL METHODS

(format: (returns) name (arguments after self))

(scalar) match (scalar)

Does the work of matching the browser type to the given version. Returns a 1 if the browser is targeted by this version.

(scalar) _test (scalar, scalar)

Internal method for comparing user-agent strings to test values. Provides the builtin tests.

BUGS/CAVEATS ^

Reserves the _setup and _generate_output methods.

AUTHOR ^

Barry King <wyrd@nospam.wyrdwright.com>

SEE ALSO ^

Apache::Wyrd

General-purpose HTML-embeddable perl object

Apache::Wyrd::BrowserSwitch
 Enclose a set of browser-versioned blocks

LICENSE ^

Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.

See LICENSE under the documentation for Apache::Wyrd.

syntax highlighting: