Bản mẫu:Liên kết hàm mô đun
{mfl} is similar to {ml}, but assumes that the function specified is documented, and thus creates a link to a section of the same name expected to be found in the documentation. Another difference with {ml} is that the behaviour of empty and undefined in the second parameter here is inverted.
Examples
Code | Result | Notes |
---|---|---|
{mfl |
{#invoke:Example} | Omits the function name |
{mfl |
{#invoke:Example|hello} | Usage with a function name. |
{mfl |
{#invoke:Example|count_fruit|bananas=10|kiwis=5} | Usage with a function name and parameters. |
{mfl |
{#invoke:Example|count_fruit|Fred|bananas=10|apples=5} | Usage with a function name and parameters, using {=}. |
{mfl |
{#invoke:Example|hàm} | Usage with a generic function name. This does not produce a usable invocation. |
TemplateData
Dữ liệu bản mẫu cho Liên kết hàm mô đun
This template displays a module name as a link surrounded by braces with the {#invoke} parser function, itself linked, thus showing how the module name would be used in code. Its primary use is in instruction and documentation.
Tham số | Miêu tả | Kiểu | Trạng thái | |
---|---|---|---|---|
module name | 1 | the module name without the namespace prefix “Module:”, which is added automatically | Chuỗi dài | bắt buộc |
function name | 2 | the function name within the module to call, expected to be documented | Chuỗi dài | tùy chọn |
parameter 1 | 3 | the name (and value) of the first parameter, use {=} to add an equal sign | Chuỗi dài | tùy chọn |
parameter 2 | 4 | the name (and value) of the second parameter, use {=} to add an equal sign | Chuỗi dài | tùy chọn |
parameter 3 | 5 | the name (and value) of the third parameter, use {=} to add an equal sign | Chuỗi dài | tùy chọn |
See also
- {ml} - Similar function but without generating links
- {tl} - A version of this template for templates instead of modules.
Định dạng mục đích chung
Kiểu liên kết → | Liên kết | Không liên kết | Liên kết với thế | Liên kết bao gồm dấu ngoặc nhọn |
Liên kết với chữ thay thế | |
---|---|---|---|---|---|---|
Kiểu chữ ↓ | ↓ Các tùy chọn{tlg} 1 →
|
— | nolink=yes
|
subst=yes
|
braceinside=yes
|
alttext=Foo 2=Foo
|
Bình thường | — | {tlg}1 {tl} {tlp}2 {Bản mẫu:tlu}3 |
{tlf}2 [link] | {thế:tls} | {tn} | {tla} |
Mã
|
code=yes hoặcplaincode=yes 4
|
{tl2} {tlx} {tltt} |
{tlc} 2 [link]{tnull} [link]
|
{subst:tlxs} {thế:tltts} {thế:tltss}5 |
— | |
In đậm | bold=yes
|
{tlb} | — | |||
Mã in đậm
|
bold=yes|code=yes
|
{tlxb}
| ||||
Mã in nghiêng
|
italic=yes|code=yes
|
{tlxi}
|
- 1
{tlg}
là tổng quát nhất, cho phép bất kỳ sự kết hợp của kiểu chữ và/hoặc tùy chọn kiểu liên kết. - 2 Ngăn chữ xuống dòng bằng cách đặt nó bên trong thẻ
<span class="nowrap">...</span>
. - 3 Cho phép liên kết đến các bản mẫu trong bất kỳ không gian tên.
- 4
|plaincode=yes
sử dụng<code style="border:none; background-color:transparent;">...</code>
. - 5 Sử dụng phông chữ đơn cách nhưng không dùng
<code>...</code>
.
Bản mẫu định dạng khác
Mã ví dụ | Hiệu ứng | Ghi chú |
---|---|---|
{tl2|Hatnote|lang=fr} |
{hatnote} |
Hỗ trợ kết nối với các dự án chị em (ví dụ, fr:Hatnote) |
{tlu|Thành viên:Ví dụ/Trang con mẫu} |
{Thành viên:Ví dụ/Trang con mẫu} | Hỗ trợ kết nối với bất kỳ không gian tên |
{demo|<nowiki>{Hatnote|lang=fr|Vài chữ}</nowiki>} |
{hatnote|lang=fr|Vài chữ}
|
Hiển thị mã và ví dụ |
{xpd|Hatnote|Vài chữ hatnote} |
"{hatnote|Vài chữ hatnote}" cho ra " " [1] |
Hiển thị mã, ví dụ và một liên kết để mở rộng bản mẫu mã |
{para|tiêu đề|<var>tiêu đề sách</var>} |
|tiêu đề=tiêu đề sách |
Các tham số bản mẫu định dạng cho màn hình, có hoặc không có giá trị |
Với các liên kết tiện ích
Mã ví dụ | Hiệu ứng |
---|---|
{lts|Hatnote} |
Bản mẫu:Hatnote(sửa thảo luận liên kết lịch sử) |
{t links|Hatnote} |
Hatnote (sửa thảo luận lịch sử liên kết # /trang con /doc /doc sửa /sbox /sbox diff /kiểm thử) |
{tfd links|Hatnote} |
Bản mẫu:Hatnote (sửa · thảo luận · lịch sử · liên kết · nhật trình · trang con · xóa) |
{tiw|Hatnote} |
Bản mẫu:hatnote (liên kết nền sửa) |
{tltt|Hatnote} |
{Hatnote} |
{tetl|Hatnote} |
{ Hatnote } |
{tsetl|Hatnote} |
{thế:Hatnote} |
{ti|Hatnote} |
Bản mẫu:Hatnote (thảo luận · liên kết · sửa) |
{tic|Hatnote} |
Bản mẫu:Hatnote (thảo luận liên kết sửa) |
{tiw|Hatnote} |
Bản mẫu:Hatnote (liên kết nền sửa) |
{tlt|Hatnote} |
{Hatnote} (thảo luận) |
{ttl|Hatnote} |
{Hatnote} (t/l) |