Jump to content

Template:Method doclink: Difference between revisions

Content deleted Content added
Created page with "<noinclude>{{Documentation subpage}} {{timw|{{BASEPAGENAME}}}} </noinclude> This renders a link to a particular anchor in automatically-generated documentation for a class at https://doc.wikimedia.org/mediawiki-core/master/php/ . Like {{tl|class doclink}} it takes a class in <code>mediawiki/core</code> and an optional <code>type=interface</code>. It adds an an <code>anchor</code> parameter to scroll to a particular part of the file (without the <code>#</code>) and a <cod..."
 
No edit summary
 
Line 1: Line 1:
<span class=plainlinks>[https://doc.wikimedia.org/mediawiki-core/master/php/{{{type|class}}}{{urlencode:
<noinclude>{{Documentation subpage}}
{{#invoke:String|replace
{{timw|{{BASEPAGENAME}}}}
|source={{#invoke:String|replace
</noinclude>
|source={{trim|{{{class|{{{1}}}}}}}}
This renders a link to a particular anchor in automatically-generated documentation for a class at https://doc.wikimedia.org/mediawiki-core/master/php/ .
|pattern=_|replace=__
Like {{tl|class doclink}} it takes a class in <code>mediawiki/core</code> and an optional <code>type=interface</code>. It adds an an <code>anchor</code> parameter to scroll to a particular part of the file (without the <code>#</code>) and a <code>method </code> parameter for the method name (or any text) to display.
}}

|pattern=\|replace=_1_1
Doxygen generates long <code>id</code> attributes for methods, so you have to click on a link to a method to get its <code>anchor</code> value from the URL. But the <code>id</code>s seem stable.
}}

|PATH}}.html#{{urlencode:{{{anchor}}}}} {{{method}}}]</span><noinclude>
It seems you can add whitespace around the <code>|</code> to make the template invocation more readable.
{{documentation}}</noinclude>

{| class="wikitable"
! Code
! Preview
|-
| <pre>{{method doclink | class=Parser | anchor=a4979a4906f0cb0c1823974a47d5bd12f | method=Parser::setFunctionHook }}</pre>
| {{method doclink | class=Parser | anchor=a4979a4906f0cb0c1823974a47d5bd12f | method=Parser::setFunctionHook }}
|-
| <pre>{{method doclink |class=RCFeedEngine | type=interface|anchor=a654d2f1299fea499b4786db3dcca73a6 |method=<code>RCFeedEngine</code>'s <code>send()</code> method}}</pre>
| {{method doclink |class=RCFeedEngine | type=interface | anchor=a654d2f1299fea499b4786db3dcca73a6 | method=<code>RCFeedEngine</code>'s <code>send()</code> method}}
|}

== See also ==

* {{tl|Class doclink}} to link to the class or interface
* {{tl|File doclink}}
* {{tl|js doclink}} for Javascript API links

<includeonly>
[[Category:External link templates]]
</includeonly>