ããããcakePHPã£ã¦ãªããªã®ãããåãã£ã¦ãªããä½ã ãã®ã±ã¼ãããã¾ãã®ï¼
ä»å試ããç°å¢ã¯ä»¥ä¸
- Windows7 64bit
- xampp
ã¤ã³ã¹ãã¼ã«
å
¬å¼ãµã¤ããããã¦ã³ãã¼ã
CakePHP: é«ééçº php ãã¬ã¼ã ã¯ã¼ã¯ã Home
zipå½¢å¼ãªã®ã§xampp\htdocsã«å±éãã¦ãã©ã«ãåããcakephpãã«å¤æ´
ãhttp://localhost/cakephp/ãã«ã¢ã¯ã»ã¹ãã¦è¡¨ç¤ºããããæåãè²ã
ã¨ã©ã¼åããããã©ã
core.phpã®ç·¨é
ã¾ãã¯ã¨ã©ã¼ãç¡ããä½æ¥ããã
"xampp\htdocs\cakephp\app\Config\core.php"ãéãã¦ä»¥ä¸ãå¤æ´
- Security.saltã®å¤ãå¥ã®é©å½ãªè±æ°åã«å¤æ´ï¼ããã©ã«ãã ã¨40æåï¼
- Security.cipherSeedã®å¤ãå¥ã®é©å½ãªæ°å¤ã«å¤æ´ï¼ããã©ã«ãã ã¨29æåï¼
/** Â * A random string used in security hashing methods. Â */ Â Â Â Configure::write('Security.salt', 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi'); /** Â * A random numeric string (digits only) used to encrypt/decrypt strings. Â */ Â Â Â Configure::write('Security.cipherSeed', '76859309657453542496749683645');
ãã¼ã¿ãã¼ã¹ã®ç·¨é
ãã¼ã¿ãã¼ã¹ã¨é£æºãããå¿
è¦ãããã
ã¾ãã¯"xampp\htdocs\cakephp\app\Config\database.php.default"ã®ãã¡ã¤ã«åããdatabase.phpãã«å¤æ´
次ã«ãã®ãã¡ã¤ã«ãéãã¦
- ã¦ã¼ã¶ã¼å
- ãã¹ã¯ã¼ã
- ãã¼ã¿ãã¼ã¹å
ãå¤æ´ããããã¼ã¿ãã¼ã¹ã¯ãããããphpMyAdminã¨ãã§ä½æãã¦ãããã¨ã
DebugKitã®ã¤ã³ã¹ãã¼ã«
以ä¸ã§ä½¿ããã¯ãããªãã ãããã©DebugKitå
¥ããã£ã¦ããè¦åãåºãã
ã¨ããããæ示ã«å¾ã£ã¦ã¤ã³ã¹ãã¼ã«ããã
ããããzipã§ãã¦ã³ãã¼ã
xampp\htdocs\cakephp\app\Pluginã«è§£åãã¦ããã©ã«ãåããDebugKitãã«ãªãã¼ã
ããã¦ãxampp\htdocs\cakephp\app\Config\bootstrap.phpãã«ä»¥ä¸ã®ä¸è¡ã追å
CakePlugin::load('DebugKit');
æå¾ã«ãxampp\htdocs\cakephp\app\Controller\AppController.phpãå ã®AppControllerã¯ã©ã¹ã以ä¸ã«å¤æ´
class AppController extends Controller { public $components = array('DebugKit.Toolbar'); }
Hello Worldããã¨ããããã表示
ãã£ã¨ãã¹ã¦ã®ã¤ã³ã¹ãã¼ã«ä½æ¥ãçµäºãæ©éä½æ¥ã«ã¨ããããã
ãD:\xampp\htdocs\cakephp\app\Viewãã«ä»»æã®ãã©ã«ããä½æãããã¨ããããä»åã¯ãHogeã
ãã®ãã©ã«ãå
ã«ãindex.ctpããä½æãã¡ãªã¿ã«ctpã¯caketemplateã®ç¥ãããã
index.ctpã«ãhogeãã£ã¦æ¸ãã¨ãã
次ã«ãxampp\htdocs\cakephp\app\Controllerãã«ã³ã³ããã¼ã©ãä½æããã
ãã¡ã¤ã«åã¯ããã£ãã®åå + Controller.phpãã¨ãªããä¾ãã°ä»åã¯ãHogeController.phpãã¨ãªãã
HogeController.phpã®å
容ã¯ä»¥ä¸
<?php class HogeController extends AppController { public function index() { } }
ããã¦ãhttp://localhost/cakephp/hogeãã«ã¢ã¯ã»ã¹ããã°index.ctpã«æ¸ããæååã表示ãããã¯ãã
ã¡ãªã¿ã«å³ä¸ã«å¤ãªã±ã¼ãã®ãã¼ã¯ã表示ããã¦ããã°DebugKitã®ã¤ã³ã¹ãã¼ã«ãæåãã¦ãã証æ ã
åèURL:
åå¿è
ãWEBéçºã«ææ¦ XAMPPã«CakePHPãã¤ã³ã¹ãã¼ã«ãã¦ã¿ã
cakephpæåã®ä¸ãã¼ã¸ã表示ãããã¾ã§ãcakephpã
cakephp2.0ã«DebugKitãå ¥ãã¦ã¿ã | ã¹ã¿ã¸ãªã»ãããSD