fuelphpã§ããã¥ã¡ã³ããã¼ãµã使ãã!! | Yamlã¨ãMarkdownã¨ã
ãªãããå ¬å¼ããã¥ã¡ã³ãã«ããã®ã£ã¦ãªãã¿ããã ããã ãªãã§ãªãã ãããã
fuelphpã®ããã¥ã¡ã³ããã¼ãµæ©è½
ãfuelphpã®ããã¥ã¡ã³ããã¼ãµå¨ãã®æ©è½ã¯é常ã«ç§é¸ãç¥ããªã人ãå¤ããããããªããã©,ãã®Configãã¡ã¤ã«ã£ã¦ã®ã¯PHPã®é åãã ãã«éãã,XMLããJSON,YAML,INIå½¢å¼ã§ããããæ¸ãããèªãããå¤æ´ã§ããã£ã¦ããããããªãã¯ã¼ã«ããããªã¯ã¼ã«ãªæ©è½ã,ãªãã§ãããããã©Configãã¡ã¤ã«åãã«ããæä¾ããã¦ããªãã®ã¯ãªããç´å¾ãããªããã ãã©(æ±ç¨çã«ä½¿ããããã«å ¬éãã¨ãã¦æ¬²ããã£ãâ¦)ãã¾ãã¨ããããããããæ©è½ãæãããã§ãã
ãã§Yamlã使ã
ãYamlã使ãã¨ãã«å¿ è¦ãªã®ã¯,ãã®ä¸è¡ã ã
require_once COREPATH . '/vendor/spyc/spyc.php';
ãªããimporté¢æ°ã¨ããã£ãæ°ããããã©,ã¾ãããã§ãåé¡ãªãã§ãããã
ãå©ç¨ããå´ã§ã¯ã
$rtn = \Spyc::YAMLLoadString($str);
ã¨ããã¦æååãé åã«å¤æã§ãããã¡ãã¼ä¾¿å©ãä»ã«ããã¡ã¤ã«ããç´èªã¿è¾¼ã¿ã¨ããããã©ã¨ã©ã¼å¦çã¨ãé¢åã ã,åºæ¬ãããã使ã£ã¦ãªãããã®è¾ºã®ç´°ããå®è£ ã¨ãã¯requireãµãã¦ããã¡ã¤ã«ã確èªãã¦ããããã°ãã¨æãã¾ãã
Markdownãããã
ãMarkdownãªãã¦ã©ã£ãã§ä½¿ã£ã¦ãã£ã?ã¨ã¯çåã«æãã¨ãããªãã ãããªããMarkdownãã¡ãã£ããå ¥ã£ã¦ã¾ãã確ãæã¯ããã¥ã¡ã³ãã®ã©ã£ãã«æ¸ãã¦ãã£ããããªæ°ããããã ãã©â¦
ãfuelphpã«å ¥ã£ã¦ãMarkdownãã¼ãµã¯PHPçéã§ã¯ã馴æã¿ã®MarkdownExtraããã£ã¡ã¯ãã¼ãã¨ãç¡ãã§ãæ®éã«ä½¿ããã¯ãã
\Markdown::parse($str)
ãããªãããã§ã使ãæ¹ãMarkdownExtraã¨ä¸ç·ã
fuelã¨å¤é¨ã©ã¤ãã©ãªã®è¦ªåæ§
ããªããåå空éã®é¢ä¿ã§fuelã¨å¤é¨ã©ã¤ãã©ãªã®è¦ªåæ§ã¯ä½ã,ã¿ãããªè©±ããã¾ã«èãããã©ã,ãã®è¾ºã®ä¾ã¨ãã¿ã¦ã¿ãã¨ããªãã¡ããã§ããªããããã?ã£ã¦ãããã¨æãã¾ãã
ãã¤ãå¥ã«åå空éããããããªããããã©ãããã¦ããã°ãããªããã¯ä¸çºã§â¦(ãã§ã¼ãã¢ã¦ã