| CGI :: EX :: À¯È¿¼ºÀ» È®ÀÎÇϽʽÿÀ CGI :: EX :: À¯È¿¼º °Ë»ç´Â JavaScript°¡ º´·Ä·Î "¿À¸¥ÂÊ"¾ç½Ä À¯È¿¼º °Ë»ç±âÀÔ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
CGI :: EX :: À¯È¿¼ºÀ» È®ÀÎÇϽʽÿÀ ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Paul Seamons
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~rhandom/
CGI :: EX :: À¯È¿¼ºÀ» È®ÀÎÇϽʽÿÀ ű×
CGI :: EX :: À¯È¿¼ºÀ» È®ÀÎÇϽʽÿÀ ¼³¸í
CGI :: EX :: À¯È¿¼º °Ë»ç´Â JavaScript°¡ º´·Ä·Î "¿À¸¥ÂÊ"¾ç½Ä À¯È¿¼º °Ë»ç±âÀÔ´Ï´Ù. CGI :: EX :: À¯È¿¼º °Ë»ç´Â JavaScript¸¦ »ç¿ëÇÏ¿© "¿À¸¥ÂÊ"¾ç½Ä À¯È¿¼º °Ë»ç±âÀÔ´Ï´Ù. ½Äº°ÀÚ´Â CGI :: EX :: À¯È¿¼ºÀ» »ç¿ëÇÕ´Ï´Ù. ### ªÀº My $ Errobj = CGI :: EX :: À¯È¿¼º °Ë»ç -> New-> À¯È¿¼º °Ë»ç ($ ¾ç½Ä, $ val_hash); ### ±ä ³» $ form = cgi-> new; # ¶Ç´Â # ³» $ form = cgi :: ex-> new; # ¶Ç´Â CGI :: EX-> get_form; # ¶Ç´Â # $ Form = {key1 => 'val1', key2 => 'val2'}; ### °¡Àå °£´ÜÇÑ My $ val_hash = {username => {Çʼö => 1, max_len => 30, field => 'username', # Çʵå´Â ¼±Åà »çÇ×ÀÔ´Ï´Ù. Å° À̸§}, À̸ÞÀÏ => {Çʼö = > 1, max_len => 100, type => 'À̸ÞÀÏ',}, À̸ÞÀÏ 2 => {equals => 'À̸ÞÀÏ',},}; ### ÁÖ¹® (Onevent Submit Only onerment ÁÖ¹® ¿À´õ ¸¸ ÁÖ¹®) My $ val_hash = { '±×·ì Order'=> , username => {Çʼö => 1, max_len => 30}, À̸ÞÀÏ =>. .., À̸ÞÀÏ 2 => ...,}; ### ´Ù½Ã ÁÖ¹® ³» $ val_hash = { '±×·ì Çʵå'=> ,}; MY $ VOB = CGI :: EX :: À¯È¿¼º °Ë»ç -> NEW; MY $ ERROBJ = $ VOB-> À¯È¿¼º °Ë»ç ($ ¾ç½Ä, $ val_hash); # or # # # any type cgi :: ex :: conf¸¦ »ç¿ëÇÏ¿© my $ errobj = $ VOB-> À¯È¿¼º °Ë»ç ($ ¾ç½Ä, "/somefile/somewhere.val")¸¦ Áö¿øÇÕ´Ï´Ù. if ($ Errobj) {my $ error_heading = $ ERROBJ-> AS_STRING; # ¶Ç´Â "$ ERROBJ"; MY $ ERROR_LIST = $ ERROBJ-> AS_ARRAY; # À߸øµÈ ³» $ error_hash = $ ERROBJ-> AS_HASH; # raterRefsÀÇ ArrayRefs} else {# Æû Æнº À¯È¿¼º °Ë»ç} ###´Â $ VAL_HASH MY $ VOB = CGI :: EX :: Validate-> New ({no_extra_keys =>) 1}); MY $ ERROBJ = $ VOB-> À¯È¿¼º °Ë»ç ($ ¾ç½Ä, $ val_hash); ³» $ js_uri_path = '/ js /'; # cgi / ex / validate.js ³» $ form_name = "the_form"À» ã´Â Á¤Àû ¶Ç´Â µ¿Àû URI °æ·Î; # ³» $ JavaScript = $ VOB-> generate_js ($ val_hash, $ form_name, $ js_uri_path)¿¡ JavaScript¸¦ ¿¬°áÇÏ´Â ¾ç½ÄÀÇ À̸§. ¿ä±¸ »çÇ× : ¡¤ Perl.
CGI :: EX :: À¯È¿¼ºÀ» È®ÀÎÇϽʽÿÀ °ü·Ã ¼ÒÇÁÆ®¿þ¾î