Smartyãã³ãã¬ã¼ã+ãªãã¸ã§ã¯ã(ã¾ã¨ã) ãSmartyãã³ãã¬ã¼ãå ã§ãªãã¸ã§ã¯ãã使ãã件ãã¨ãSmartyãã³ãã¬ã¼ã+ãªãã¸ã§ã¯ã(ããããã¦ãã¦ç·¨)ãã®ã¾ã¨ãã æ¨èªçã«ããã°ãSmartyã«assignããå¤æ°ã¯ã åã¢ã¯ã·ã§ã³ã³ã³ããã¼ã©ã§è¨å®ããå ´åã§ãã£ã¦ãã ãã¨ããå ±éå¤æ°ã«ã§ããããã«ãã¦ãããã¨ãããã¨ã«ãªãã¾ãã å ·ä½çã«ã¯ãååãé層åããããã¨ã§ããã³ãã¬ã¼ããèªã¿ããããããã¨ã¨ã å¤ãåºãã®ã«æéã®ããããã®ã¯ã ãã³ãã¬ã¼ãããå¼ã°ããã¨ãã«å¤ãåºãããã«ãã (ãããã¯ããã¨ããããå¤æ´ã§ããããã«ãã)ãã¨ã§ãã ãã®ä¸¡æ¹ãã§ããããã«ããããã«ã $fortune = new Fortune($user); // ããããªå ãã®ã§ããã¯ã©ã¹ $smarty->assign('luckyColor', $fortune->getLucyCo
I was busy for the last couple of weeks for my Baby and Zend Certification Exam. While spending time for those, I also managed few hours to modify the existing Smarty Cheat Sheet version 1.0 and added many new features requested by Boots (One of the administrator of Smarty Forum) and others. So here comes the new and updated version of Smarty Cheat Sheet. I hope it will satisfy everyone. Download
ã¯ããã« æ¬é£è¼ã§ã¯ãPHPä¸ã§åä½ããã¢ããªã±ã¼ã·ã§ã³ãã¬ã¼ã ã¯ã¼ã¯ã§ããZend Frameworkã«ã¤ãã¦ç´¹ä»ãã¦ããã¾ããååã®äºåã©ãããä»åã¯ãã¥ã¼ãã«ãã¼ãèªä½ããæ¹æ³ãZend Frameworkã¨Smartyãé£æºãããæ¹æ³ã«ã¤ãã¦ã®èª¬æãè¡ãã¾ããä»åç´¹ä»ããSmartyã¯ã¦ã§ããã¼ã¸ã®ãã¶ã¤ã³ã¨è¨è¨ãåããããã®ä»çµã¿ã®ä¸ã¤ã§ãä¸æã«ä½¿ãã°ã¦ã§ããµã¤ãã®ç®¡çã®æéãæ¸ãããã¨ãã§ãã¾ãã 対象èªè PHPã®åºæ¬æ§æã¯ä¸éãç解ãã¦ãããããã¬ã¼ã ã¯ã¼ã¯ãå©ç¨ãããã¨ã¯ãªãã¨ããæ¹ã対象ã¨ãã¦ãã¾ãã ããã¾ã§ã®è¨äº Zend Frameworkå ¥éï¼1ï¼ï¼ãã¬ã¼ã ã¯ã¼ã¯ã®å ¨ä½åã¨ã¤ã³ã¹ãã¼ã« Zend Frameworkå ¥éï¼2ï¼ï¼Hello World!ã¢ããªã±ã¼ã·ã§ã³ã®ä½æ Zend Frameworkå ¥éï¼3ï¼ï¼PHPã§MVCã¢ããªã±ã¼ã·ã§ã³ãæ§ç¯ããã - Z
Smartyã¨ã¯ å¤©ç½ é²ä¹, å»£å® ç¥ä¹, ä¸æ¨ å ç¯ ISDL Reportã No. 20050915004 2005å¹´ 10æ 14æ¥ Abstract PHPã§webããã°ã©ãã³ã°ãè¡ãéï¼PHPã®ããã°ã©ã ã®ä¸ã«HTMLã®ã³ã¼ããæ··å¨ããã¦è¨è¿°ããï¼ãã®ããï¼ãã¼ã¸ã®ãã¶ã¤ã³ãå¤æ´ããéã«ï¼HTMLã ãã§ãªãï¼PHPã®ã³ã¼ããæ¸ãæãããªããã°ãªããªãå ´åãããï¼PHPã®ããã°ã©ã ã®ä¿å®æ§ãä½ä¸ãããåå ã¨ãªã£ã¦ããï¼Smartyã¯ï¼PHPããã°ã©ã ã®ãã³ãã¬ã¼ãã¨ã³ã¸ã³ã§ããï¼Smartyã«ãã£ã¦ï¼PHPããã°ã©ãã³ã°ã«ããããã¼ã¸ã®ãã¶ã¤ã³ã¨ï¼ãã¸ãã¯ã®ã³ã¼ãã£ã³ã°ãåé¢ãããã¨ãã§ããï¼æ¬å ±åã§ã¯ï¼Smartyã®ä»çµã¿ã¨ç¹å¾´ã¨ï¼ã¤ã³ã¹ãã¼ã«ï¼è¨å®æ¹æ³ã«ã¤ãã¦è¿°ã¹ãï¼ 1  ã¯ããã« PHPã§webããã°ã©ãã³ã°ãè¡ãéï¼PHPã®ããã°ã©ã ã®ä¸ã«HTMLã®ã³ã¼ããæ··å¨
PHPããSmartyã¸é åã渡ããé åã®æ°ã ãã«ã¼ãããã¦è¡¨ç¤ºãããã åºæ¬çãªæ©è½ã {section name=ã«ã¼ãæ§å¤æ° loop=é åå¤æ°} {$表示ããé å[ã«ã¼ãæ§å¤æ° ]} {/section} ä¾ PHP $array_data=array(9,8,7,6,5,4,3,2,1); $smarty->assign("data",$array_data); ãã³ãã¬ã¼ã {section name=cnt loop=$data} {$data[cnt]} {/section}
ä»åã¯Zend_View_Interfaceãå®è£ ãã¦Smartyã«å¯¾å¿ããããã¥ã¼ãZend_Layoutã¸å¯¾å¿ããã¦ã¿ããã¨ãã試ã¿ã§ãã 使ç¨ããSmartyã®ã¯ã©ã¹ã¯ãã(ViewSmarty)ã§ãã ã¾ãã¯Zend_Layoutã«viewãç»é²ããæ¹æ³ã§ããã以ä¸ã®ã©ã¡ããã®æ¹æ³ã§ViewSmartyã®ã¯ã©ã¹ãç»é²ãã¾ã(ã¾ã ä»ã«ãããããããã¾ãã)ã Zend_Layoutã®$_viewããããã£ã«è¨å®ãã Zend_Controller_Action_Helper_ViewRendererã«ç»é²ãã ã»Zend_Layoutã®$_viewããããã£ã«è¨å®ãã
ãªããSmartyå ¥éè¨äºãã¯ãã£ã¦ãããããªã®ã§æ¸ããã Smartyã®æ§æ(é¢æ°)ã修飾åãã«ã¹ã¿ã é¢æ°ã®ä¸ããããã使ããã®ã»ææªããã ãç¥ã£ã¦ãã°å¤§ä½ãããããã¨ãããã®ãããã¯ã¢ãããã¾ããã ãã以å¤ã«ãããããã®é¢æ°ã修飾åãããã¾ãã®ã§ãç¥ãããæ¹ã¯ããã¥ã¢ã«ãããã£ã¦ã¿ãã¨è¯ãã§ãã ã¾ãããã¥ã¢ã«ãè¦ãã°å¤§ä½ããããã¨ã§ãããéå¼ããããã¨ä¾¿å©ã£ã¡ãã便å©ã»ã»ã»ã§ããï¼ä¾¿å©ã§ãããï¼ï¼ã ã¤ã¼ãæåã®ã»ããªãã¦ã¾ãã¾ããã¥ã¢ã«è¦ãã°ãããã¨ã§ãããããã¾ããã£ãã ç®æ¬¡ ã¯ããã«(Smartyã使ãããã«) Smartyã®è¨å® Smartyã®è¨ç½® å¿ è¦ãªãã£ã¬ã¯ã㪠Smartyã使ãããã®PHPãã¡ã¤ã«ã®è¨è¿° æä½éå¿ è¦ãªã㨠PHPãããã³ãã¬ã¼ãã«è¡¨ç¤ºããå¤æ°ãä»£å ¥ãã ãã³ãã¬ã¼ããæå®ãã¦åºåãã Smartyãã³ãã¬ã¼ãå´éå¼ããªãã¡ã¬ã³ã¹(ãã³ãã¬ã¼ããã¶
æ¦è¦ JSmartyã¯PHPã®Smartyã模ããJavaScriptã§åããã³ãã¬ã¼ãã¨ã³ã¸ã³ã§ãããã³ãã¬ã¼ãAPIé¨åã«ã¤ãã¦ã¯Smartyãæºæ ãã¦ããããã以å¤ã«ãæååå¦çã便å©ã«ãªãããã«APIãæä¾ãã¾ãã ã㢠http://www.starmsg.net/samples/JSmarty/plugin.html ãã¦ã³ãã¼ã http://code.google.com/p/jsmarty/downloads/list Hello World!! <script src="JSmarty.js"></script> <script src="JSmarty/Compiler.js"></script> var smarty = new JSmarty(); smarty.assign("foo", "Hello World!!"); smarty.display("str
Smart*CSSã¨ã¯ Smart*CSSã¯æ§é åï¼é層åããããã¯å ¥ãåï¼ããCSSãåçã«å¤æãã¦åºåããã·ã¹ãã ã§ããå¤æã¯Smart*CSSãèªåã§ãã£ã¦ãããã®ã§ããæå ã§å¤æãã¦ããã®ãã¡ã¤ã«ãã¢ãããã®ãããªé¢åãªãã¨ã¯ä¸åå¿ è¦ããã¾ããã CSSã¨ããã®ã¯ãè¨èªãã¨ãã¦è¦ãå ´åãé常ã«ã¤ã±ã¦ãªãä»æ§ã«ãªã£ã¦ãã¾ãã #content p { ï½ } #content h1 { ï½ } #content ul { ï½ } ã®ãããªCSSãæ¸ãã¦ãä½ã§æ¯åº¦æ¯åº¦#contentã¨ãæ¸ããªããããããã¨ãã¬ããã«ãªã£ãçµé¨ã®ãã人ã«ä½¿ã£ã¦é ããã°å¹¸ãã§ããç¹ã«ä½ãããã°ã©ã è¨èªãç¥ã£ã¦ãã人ã«ã¯é¦´æã¿ãããããããªãã§ããããã Smart*CSSã使ç¨ããã¨ãCSSããã®ããã«æ§é åãã¦æ¸ããã¨ãåºæ¥ãããã«ãªãã¾ããè¨è¿°æ¹æ³ã®è©³ç´°ã¯Exampleãã覧ãã ããã #conten
å ¨å½1ä¸2000人ã®smartyã¦ã¼ã¶ã¼ã®çæ§ãããã«ã¡ã¯ãtanakaã§ãã ãã¨ã®å§ã¾ãã¯ããã¤ãã¨ãªãã§ãWebã¢ããªã±ã¼ã·ã§ã³ã®ãªãããããç±å¼ãã¦ãããå 輩ã®kimotoã¨ã®ä¼è©±ã§ããã 社å æè¡ãµãã¼ãã§å¿ããkimoto html_checkboxes(ãã§ãã¯ããã¯ã¹ãç°¡åã«çæããsmartyã®é¢æ°)ã£ã¦ãã¾ãã¡ä½¿ãã«ãããã ããã¼ãè¦ç´ ã¨è¦ç´ ã®éã«èªç±ã«æååç½®ããªãã çææ°ãªæ°äºº tanaka _ ã â© (ãï¾âï¾)彡ãæ¡å¼µï¼æ¡å¼µï¼ â彡 smartyã®å ¥éæ¸ãèªã¿ããã£ã¦ãã¦ãããçè«ã ãã¯ããã£ã¦ãããµãããã¦ããåã¯ãæ¡å¼µã®å®è£ æ¹æ³ããããªãã¾ã¾ã«èª¿åã«ã®ã£ã¦ããã¹ã£ã¦ãã¾ããã html_checkboxesã®ä½ã使ãã«ããã®ãã¨ããã¨ãseparatorã«ã²ã¨ã¤ã®æååããæå®ã§ããªããã¨ã§ãã ã¤ã¾ãã以ä¸ã®ãããªã³ã¼ããæ¸ãã¨ãã¾ãã test.ph
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}