UtilsPluginã®å 訳
ä¸ã®è¨äºã§åå¨ãç¥ã£ãã®ã§ããã
CakePHPã«ãæ§ã
ãªãã¡ãã£ã¨ããå¦çãã追å ã§ãã UtilsPlugin ã¨ãã便å©ãªãã®ãé
å¸ããã¦ãã¾ãã
http://1-byte.jp/2011/01/06/open_trivist/
ãããã公式ページ(ver.1.1)ããREADMEãèªãã§ããä½ã«ã©ããã£ã¦ä½¿ãããã¡ãã£ã¨åãããªãç©ãããã¾ãã
ããã§ãUtilãã©ã°ã¤ã³Ver.1.1ã§ä½ãã§ããã®ããèªåãªãã«ã½ã¼ã¹ã解èªããã¡ã¢ã§ãã
PingBackãTinySluggableãArchiveãCleanupãListãªã©ãå®éã«ä½¿ã£ã¦ã¿ããæ©è½ããã£ãã®ã§ã
å®éã«ä½¿ç¨ããããå
·ä½çãªå°å
¥æ¹æ³ããå¥éè¨äºã«ãã¾ãã
ã¾ããUtilsPluginãé
å¸ãã¦ããCakeDCæ§ã§ã¯ãä»ã«ãæ§ã
ãªãCakePHPç¨ã®ä¾¿å©ãªãã©ã°ã¤ã³ãéçºï¼å
¬éãã¦ãã¾ãã
http://cakedc.com/eng/downloads
Cake Development Corporation · GitHub
ãããããæ©ä¼ãããã°å°å
¥æ¤è¨ãããã§ãã
ããã¤ãã¢
Btree
ããããããBæ¨ãæ§é ã§ãã¼ã¿ãä¿åããã
B木 - Wikipedia
CsvImport
ãCVSãã¼ã¿ãã¤ã³ãã¼ããã¦ãæå®ã¢ãã«ã«åãè¾¼ã
Inheritable
ãã¢ãã«ã®ç¶æ¿ãè¡ã
åèï¼http://bakery.cakephp.org/articles/taylor.luk/2008/10/22/inheritable-behavior-missing-link-of-cake-model
ããpeopleããã¼ãã«ã®æ
å ±ããemploeeãã«å¼ãç¶ãããªã©ã®ä½¿ãæ¹ãã§ãã
Keyvalue
field->value ã¨ããæ§é ã®ãã¼ã¿ãä¿å(saveSection())ï½¥èªã¿è¾¼ã¿(getSection())ããã
以ä¸ã®ãã¼ãã«æ§é ãæ³å®ãã¦ãã模æ§ã
id | èªå | ||||
foreign_key(å¤æ´å¯è½ï¼ããã©ã«ãã§user_id) | [ã¦ã¼ã¶IDãªã©] | ||||
field | Sectionå(å¤æ´å¯è½ã空OK).keyå | ||||
value | ä»»æ |
ä¾ãã°usersãã¼ãã«ã«é¢é£ä»ãã¦ã
ç¹å®ã®ã¦ã¼ã¶ï¼user_id)ã«é¢é£ãããã¼ã¿ã ãåå¾ï½¥ä¿åãããã
ç¹å®ã®Sectionã®ãã¼ã¿ãå
¨å¡ååå¾ã§ãããããã
ããã¨ãusersã«ç´æ¥ä¿åããã®ã¨æ¯ã¹ã¦ãé ç®æ°ãå¢ããã®ã«ãã¼ãã«æ§é å¤æ´ãä¸è¦ã«ãªãã»ã»ã»ã¨ããBehavoirã§ããããã
List
é çªæå®ã®ããä¸è¦§ãã¼ã¿ããæä½ã»åå¾ããã
Ajaxã¨çµåããã¦ä½¿ãã¨é¢ç½ããã
ãã¼ãã«ã«ã¯ãé çªãæå®ããã«ã©ã (positionï¼ã«ã©ã åå¤æ´å¯è½)ãããã
positionã«ã1å»ã¿ã§é çªãæå®ããã¦ãããã¨ãåæã
ï¼ãã¼ãã«ã®ã¤ã¡ã¼ã¸ï¼
id | position | name | value | ã»ã»ã» | |||||
1 | 1 | A | *** | ã»ã»ã» | |||||
---|---|---|---|---|---|---|---|---|---|
5 | 2 | B | *** | ã»ã»ã» | |||||
6 | 3 | C | *** | ã»ã»ã» |
é¢æ°
ãinsertAt() positionãæå®ãã¦Insert/Updateã
ãmoveLower() idãæå®ãã¦ãpositionã1ä¸ãã
ãmoveHigher() idãæå®ãã¦ãpositionã1ä¸ãã
ãmoveToBottom() idãæå®ãã¦ãä¸çªä¸ã«ç§»å
ãmoveToTop() idãæå®ãã¦ãä¸çªä¸ã«ç§»å
ãremoveFromList() idãæå®ãã¦ãä¸è¦§ããåé¤(positionèªå調æ´)
ãisFirst() idãæå®ãã¦ãæåã®é
ç®ãã©ãããã§ãã¯
ãisLast() idãæå®ãã¦ãæå¾ã®é
ç®ãã©ãããã§ãã¯
ãhigherItem() idãæå®ãã¦ãä¸ã¤ä¸ã®é
ç®åå¾
ãlowerItem() idãæå®ãã¦ãä¸ã¤ä¸ã®é
ç®åå¾
positionãç¹ã«æå®ããã«save/deleteè¡ã£ãå ´åã¯ãbeforeSaveã¨AfterDeleteã®æ©è½ã§èªåçã«è¨å®ããã¾ãã
Lookupable
é¢é£ä»ãã®ãããã¼ã¿ãåç
§ã»ä¿åããã
ãå人çã«ã¯ãé¢é£ä»ãã¯æèãã¦ON/OFFããã®ã好ããªã®ã§ã使ãæãå¾®å¦ï½¥ï½¥ï½¥
Pingbackable
PingBackããã©ãã¯ããã¯æ©è½ãå®è£
ããã®ã«ä¾¿å©ãªBehavoirã
PingBackå
ããã©ãã¯ããã¯å
ã®ãã¼ã¸å
容ãåå¾ãã¿ã°ãªã©ãã¯ãªã¼ã³ã¢ãããã¦ãã¼ã¿ãã¼ã¹ã«ä¿åã¾ã§å¯è½ã§ãã
ãã¼ã¿ãã¼ã¹ã«ä¿åããå ´åããã¼ãã«ã®æ¸å¼ãå
容ã¯ããç¨åº¦è¦å®ããã¾ãã
Publishable
ãã¼ã¿ããå
¬éãããã¨ãã«ããå
¬éæ¥ããè¨é²ãããããããã¤ãã¢ã
ã»ã»ã»ããããæ£ç´ããåããã¾ããã»ã»ã»
Serializable
$this->dataä¸ã®æå®ã®fieldããã·ãªã¢ã«åããããåå¾ããã·ãªã¢ã«åãã¼ã¿ãæ»ãããã¤ãã¢ã
対象ã®fieldããã¼ã¿ããªãã£ãå ´åã®ã¨ã©ã¼ãªã©ãåé¿ãã¦ãã模æ§ã
Sluggable
ä¿åãããã¼ã¿ã®ã¿ã¤ãã«ãªã©ãæ£è¦åããããã¤ãã¢ã
uniqueåãå¯è½ï¼é£çªæ°åãæ«å°¾ã«ã¤ããå½¢ï¼
SoftDelete
delete()é¢æ°ã®å¦çããSoftDelete(ãã¼ã¿ãã¼ã¹ä¸ã¯ãã¼ã¿ãæ®ããªããã表示ãããªãï¼ã«å¤æ´ããããã¤ãã¢ã
対象ã®ã¢ãã«ã«ã¯ãåé¤æ¥æãè¨é²ããã«ã©ã (deleted_date)ã®è¿½å ãå¿
è¦ã
SoftDeleteç¶æ ã®ãã¼ã¿ãåå¾ããããå ã«æ»ãæ©è½ãªã©ãå å®ãã¦ãã¾ãã
TinySluggable
æå®ã®æååãã¼ã¿ãç縮ã»æ£è¦åãã¦ä¿åããããã¤ãã¢ã
å¤æå¾ã®æååã¯åè§è±æ°åã®ã¿ã§ãå¿
ãuniqueã«ãªãã
bit.lyã®ãããªURLç縮ãªã©ã«ç¨ããã¨è¯ããã¨ããå¿åãããã
Toggleable
ãã¼ã¿ã2ã¤æå®ãã¦ãå¾ã®ãã¼ã¿å 容ã§åã®ãã¼ã¿ãç½®æãã¦ä¿åããï¼ï¼ï¼
ã©ã¤ãã©ãªã¼
ã³ã³ãã¼ãã³ã
Archive
æå®ã³ã³ããã¼ã©ä»¥ä¸ã®ãã¼ã¿ããå¹´ã»ææ¯ã«ä»¶æ°ãéè¨ããã
ä¾ãã°ãDiaryControllerã§ç¨ããã¨ã
$data = array( '0' => array('2011', '01', '39'), '1' => array('2011', '02', '50'), '2' => array('2011', '03', '11'), ..... )
ã®ãããªãã¼ã¿ãå¾ããã¦ãã2011å¹´1æã®æ¥è¨(39件)ããªã©ã®è¡¨ç¤ºãã§ããã
éè¨åºæºã¯ããã©ã«ãã§ãcreatedãã ããmodifiedãªã©ã«ãå¤æ´å¯è½ã
FormPreserver
ãã©ã¼ã ãéä¿¡ãããããã°ã¤ã³ãå¿ è¦ãã§ãã£ãå ´åããã°ã¤ã³ãã¦æ»ã£ã¦ããæã¾ã§å ¥åå 容ãä¿æãç¶ããæ©è½ã
é·ææ¸ãã¦èªè¨¼æéåãã«ãªããããªå ´åãªã©ã«å¯¾å¿ã§ãããã
ãã¼ã¿ã¯ã»ãã·ã§ã³ã§ä¿ç®¡ã
Pingbacks
PingBack/ãã©ãã¯ããã¯ãéä¿¡ããã
ããã¤ãã¢ã¯ãåå¾ãæ©è½ãã¡ã¤ã³ãªã®ãéãã®ããã§ãã
Referer
add/editãæåããå¾ãå ã®ãã¼ã¸ã«æ»ãæ©è½ã
æ»ããããã¼ã¸ã§ãReferer->setReferer()ãã¦ããã¨ãadd/editæåå¾ã«Referer->rdeirect()ã§ãã®ãã¼ã¸ã«æ»ããããã§ãã
Utils
Utilãã©ã°ã¤ã³ã®ä¸ã§æ´ã«ããã®ä»è²ã ãçãªé¢æ°ç¾¤ãï¼
ç¾å¨ãcleanHtml()ã¨ãããUtils.Cleanerãã«ãã¼ã®å¦çãè¡ãé¢æ°ãããã¾ãã
ãã«ãã¼
Cleaner
ä¸è¨Utilã³ã³ãã¼ãã³ãã§å¼ã°ãã¦ãããã«ãã¼ã
æå®ããã¿ã°ã ãã許å¯ãã¦ãã®ä»ã®ã¿ã°ãåé¤ããããæ¬ãæ¼ããã¿ã°ãåé¤ãããããã
[]ã§æ¬ã£ã(?)GoogleVideoãYoutubeã®URLãããªã³ã¯ããã¬ã¤ã¤ã¼ã«èªåå¤æããé¢æ°bbcode2js()ãããã
æ¥æ¬äººçã«ã¯ãæ¡å¼µãã¦ãã³å対å¿ã欲ããã¨ãããã»ã»ã»ã
Gravatar
Gravatarã«å¯¾å¿ããããã®ãã«ãã¼ã
Gravatarã¨ã¯ Gravatar - グローバルに認識されるアバター (Globally Recognized Avatars)
Tree
ãã¼ã¿ãããªã¼ä¸ã«æ£è¦åãããã«ãã¼ã
以ä¸