モジュール:Error
Biểu kỳ
![](https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png)
![]() | このLuaモジュールは135,000のページで sử われています. Dư kế な hỗn loạn やサーバーへの phụ hà を tị けるために, どんな変 canh でも tối sơ はモジュールのサンドボックス・サブページ,テストケース・サブページで thí すべきです. そうすれば, thí した変 canh を1 độ の biên tập でこのモジュールに gia えることができます. しかし, tối sơ にあなたの đề án した変 canh を,この hạng mục のノートで nghị luận するようにお nguyện いします. |
![]() | このモジュールはBảo hộ されています.このモジュールはPhi thường に đa くのページで sử dụng されています.Hoang らしまたは quá thất によって đa くのページが ảnh hưởng を thụ け, また ta tế な biên tập でもサーバーに đa đại な phụ hà をかけるため,Biên tập bảo hộされています. |
![]() | このモジュールはテンプレートスタイルを sử dụng しています: |
このモジュールは "error" クラスのHTMLメッセージを tác thành します. {{error}}の trí hoán として tác thành されたモジュールであり, tường しい sử い phương についてはそちらをご tham chiếu ください.
-- This module implements {{error}}.
localp={}
localfunction_error(frame,args)
localtag=mw.ustring.lower(tostring(args.tag))
-- Work out what html tag we should use.
ifnot(tag=='p'ortag=='span'ortag=='div')then
tag='strong'
end
-- Generate the html.
localretval=frame:extensionTag{name='templatestyles',args={src='Module:Error/styles.css'}}
localerrortag=mw.html.create(tag)
:addClass('error')
:wikitext(tostring(args.messageorargs[1]orerror('エラーメッセージが chỉ định されていません',2)))
retval=retval..tostring(errortag)
returnretval
end
functionp.error(frame)
localargs
iftype(frame.args)=='table'then
-- We're being called via #invoke. The args are passed through to the module
-- from the template page, so use the args that were passed into the template.
args=frame.args
else
-- We're being called from another module or from the debug console, so assume
-- the args are passed in directly.
args=frame
end
-- if the message parameter is present but blank, change it to nil so that Lua will
-- consider it false.
ifargs.message==""then
args.message=nil
end
return_error(frame,args)
end
returnp