Bản mẫu:Missing param/doc

Bách khoa toàn thư mở Wikipedia


This helper template provides a means of testing if a specified number of parameters are defined. It will test n parameters n is between 1 and 10. It is intended to be used in other templates.

Returns the a number which indicates the first undefined parameter or the empty string if all parameters are defined. n specifies the number of parameters expected.

Cách sử dụng

{{missing param|n=4|1|2|3|4}}

{{missing param|n=4|1| |3|4}} → 2

{{missing param|n=4|1|2|3| }} → 4

Các ví dụ

{{Lỗi
| {{#switch: {{missing param|n=3|1| |3}}
  | 1 = Tham số thứ 1 là mất tích.
  | 2 = Tham số thứ 2 là mất tích.
  | 3 = Tham số thứ 3 là mất tích.
  | ... }} }}

Tham số thứ 2 là mất tích.

{{#if: {{missing param|n=3|1| |3}}
  | Đó là một tham số mất tích.
  | ...
}}

→ Đó là một tham số mất tích.

Xem thêm