Actions

Template

Jmeth/doc

From Joomla! Documentation

< Template:Jmeth
Revision as of 12:47, 9 May 2008 by CirTap (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a documentation subpage for Template:Jmeth.
It contains usage information, categories and other content that is not part of the original template page.
To view the template page itself, see Template:Jmeth.

Creates a link to a Class Method in the Joomla! Framework.

See #Known issues below about the trouble with static and private methods starting with an underscore in their name (_) and how it has been solved.

Usage

{{jmeth|class|method|[byref]}} Examples

  • {{jmeth|JWhatever|foo}} gives
    Method.png
    foo() -- regular method notation
  • {{jmeth|JWhatever|bar|&}} gives
    Method.png
    &bar() -- return by reference notation
  • {{jmeth|JWhatever|bat|}} gives
    Method.png
    bat()
  • Method.png
    bat()
  • {{jmeth|JWhatever|_}} gives
    Method.png
    _() -- "magic" underscore trick _ (U+005D) vs ‗ (U+2017)

Parameters

Parameter Name Parameter Description req./opt.
{{{1}}} name of class, i.e JObject Required.
{{{2}}} name of method, i.e toString Required.
{{{3}}} by-ref prefix, given literally as & optional.

Known issues

Several classes contain static methods called "_" (underscore) such as JHTML::_ and JText::_
In Mediawiki the underscore character is a placholder for the space character in page titles. In order to have a page named "_" these pages are renamed using the double underscore Unicode character U+2017: ‗ -- This template takes care of the issue.

If a subpage is supposed to be named "_", like JHTML/_, Mediawiki will remove this leading space which results in the pagename to become JHTML/ -- a trailing slash. This is a legitimate name for a page in MW (at least up to 1.11), but nobody would be able to find it... To prevent dead links for these (rare) pagenames, the page [[JHTML/_]] (given wih an underscore) will redirect to JHTML/‗ (double underscore, the real page.)

Chunk:Framework templates/API templates