| Catalyst :: ÄÁÆ®·Ñ·¯ :: Á¦¾à Catalyst :: Controller :: Constraints´Â ÄÁÆ®·Ñ·¯ ÀÛ¾÷À»À§ÇÑ Á¦¾à Á¶°Ç ¼¸íÀÌ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
Catalyst :: ÄÁÆ®·Ñ·¯ :: Á¦¾à ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Robert Sedlacek
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~phaylon/
Catalyst :: ÄÁÆ®·Ñ·¯ :: Á¦¾à ű×
Catalyst :: ÄÁÆ®·Ñ·¯ :: Á¦¾à ¼³¸í
Catalyst :: Controller :: Construsts´Â ÄÁÆ®·Ñ·¯ ÀÛ¾÷À»À§ÇÑ Á¦¾à Á¶°Ç ¼¸íÀÌ µé¾î ÀÖ½À´Ï´Ù. Catalyst :: Controller :: Contrvertions ÄÁÆ®·Ñ·¯ Actions.Synopsis ÆÐÅ°Áö¿¡ ´ëÇÑ Á¦¾à Á¶°Ç ¼¸íÀÌ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù. Synopsis Package MyApp :: Controller :: Foo; ... ±âº» QW (Catalyst :: Controller :: Á¦¾à)¸¦ »ç¿ëÇϽʽÿÀ. __package __-> config (constraints => {# À¯Çü 'Á¤¼ö'À¯Çü¿¡ ´ëÇÑ ¼ýÀÚ ¸¸ Çã¿ë 'qr / ^ d + $ / #'´Ü¾î 'word => sub {/ ^ w + $ /}¿¡ ´ëÇÑ ´Ü¾î ¹®ÀÚ ¸¸ Çã¿ë, # »ç¿ëÀÚ IDÀÇ À¯È¿¼º °Ë»ç ¹× °´Ã¼ »ç¿ëÀÚ¿¡°Ô inflate user => {# »ç¿ëÀÚ ID È®ÀÎ => ÇÏÀ§ {³» ($ self, $ c, $ id) = @_; $ c-> is_valid_user_id ($ ID); #ÀÌ Á¶Ä¡·Î Àü´Þ on_fail => 'invalid_user'°¡ ½ÇÆÐÇÑ °æ¿ì # °ªÀÌ À¯È¿ÇÑ °æ¿ìÀÌ ÇÊÅÍ # ÀÌÈÄ post_filter => sub {my ($ self, $ c, $ id) = @_; $ c-> fetch_user_by_id ($ ID);}, »ó¼Ó highinteger => {inherit_from => integer ', check => sub {$ _> 22}, # ´ÙÁß Àμö Ãà¼Ò myDate => {# 3 Á¤¼ö ±×¸®°í ÇϳªÀÇ °ªÀÌ => 3À» ¹ÝȯÇÏ°í,ÁÖ´Â => 1, # datetime object post_filter => sub {my ($ self, $ c, $ y, $ m, $ d) = @_; datetime-> new (year => $ y, month => $ m, day => $ d);}}}); # µÎ °³ÀÇ Á¤¼ö¸¦ Ãß°¡ÇÏ°í, Á¦ÇÑ Á¶°Ç ½ÇÆÐ ÇÏÀ§ Ãß°¡ : ·ÎÄà args (2) Á¦¾à Á¶°Ç (Á¤¼ö A, Á¤¼ö B) {³» ($ self, $ c) = @_; $ C-> res-> body ($ _ {a} + $ _ {b}); } # Å°¸¦ 'foo'ÇÏÀ§ StashWord¿¡¼ ¼û±è¿¡ ³Ö½À´Ï´Ù. stashword : ·ÎÄà args (1) Á¦¾à Á¶°Ç (Word foo *) {} # user_obj´Â stash sub view_userÀÇ »ç¿ëÀÚ °´Ã¼·Î ³¡³³´Ï´Ù. local args (1) Á¦¾à Á¶°Ç (user user_obj *) {} sub validation_user : °³ÀÎ {# À߸øµÈ UserID} 1; ¿ä±¸ »çÇ× : ¡¤ Perl ¿ä±¸ »çÇ× : ¡¤ Perl.
Catalyst :: ÄÁÆ®·Ñ·¯ :: Á¦¾à °ü·Ã ¼ÒÇÁÆ®¿þ¾î