如题所述
å·¥å
·åæï¼çµè+thinkphp
thinkphpçæåºç¡æ§å¶å¨æ¹æ³å¦ä¸ï¼
ä¸ãç®å½å¯¹åºå ³ç³»
F:\\PHPââindex.php å ¥å£æ件ââREADME.md READMEæ件ââApplication åºç¨ç®å½ââPublic èµæºæ件ç®å½ââThinkPHP æ¡æ¶ç®å½
äºãthinkphp çç®å½ç»æ
ThinkPHP çç®å½ç»æéå¸¸æ¸ æ°å容æé¨ç½²ã大è´çç®å½ç»æå¦ä¸ï¼ä»¥é¡¹ç®ä¸ºåºç¡è¿è¡é¨ç½²ã
ââThinkPHP æ¡æ¶ç³»ç»ç®å½â â ThinkPHP.php ç³»ç»å ¬å ±æ件â â Common å ¬å ±æ件ç®å½â â Tpl æ¡æ¶ç³»ç»æ¨¡çç®å½â â Lang ç³»ç»è¯è¨å ç®å½â â PlugIns å ¬å ±æ件ç®å½â â Lib ç³»ç»åºç±»åºç®å½â â Think ç³»ç»è¿è¡åºï¼å¿ é¡»ï¼â â Com æ©å±ç±»åºå ï¼éå¿ é¡»ï¼â â ORG æ©å±ç±»åºå ï¼éå¿ é¡»ï¼ âââApplication åºç¨ç®å½ã项ç®ç®å½â â index.php 项ç®å ¥å£æ件ï¼å¯ä»»ææ¾ç½®ï¼â â Cache 模çç¼åç®å½â â Common å ¬å ±æ件ç®å½ï¼éå¿ é¡»ï¼â â Conf 项ç®é ç½®ç®å½â â Data 项ç®æ°æ®ç®å½â â Html éææ件ç®å½ï¼éå¿ é¡»ï¼â â PlugIns æ件ç®å½ï¼éå¿ é¡»ï¼â â Tpl 模çæ件ç®å½â â Lang è¯è¨å ç®å½ï¼éå¿ é¡»ï¼â â Logs æ¥å¿æ件ç®å½â â Temp æ°æ®ç¼åç®å½â â Lib åºç¨ç±»åºç®å½â â Action æ§å¶å¨ï¼æ¨¡åï¼ç±»ç®å½â â Model Model ç±»æ件ç®å½â ⦠ä¸é¢çåºç¨ç®å½å¯æ ¹æ®éè¦éæ©åå®ä¹â â Exception å¼å¸¸ç±»åºç®å½â â Common å ¬å ±åºç¨ç±»ç®å½â â Help å©æç±»ç®å½âââ¦æ´å¤é¡¹ç®ç®å½ï¼åApp ç®å½ç±»ä¼¼ï¼æ¯ä¸ªé¡¹ç®éç¨ç¬ç«ç®å½ï¼ä¾¿äºé¨ç½²ï¼âââPublic ç½ç«å ¬å ±ç®å½ï¼å¤é¡¹ç®å ¬ç¨ï¼â â Js JS ç±»åºç®å½ï¼å»ºè®®ï¼â â Images å ¬å ±å¾åç®å½ï¼å»ºè®®ï¼â â Uploads å ¬å ±ä¸ä¼ ç®å½ï¼å»ºè®®ï¼
ä¸ãâF:\PHP\Applicationâç®å½ä¸æ个âhomeâç®å½ï¼è¿æ¯ThinkPHPèªå¨çæçä¸ä¸ªæ§å¶å¨ï¼
主è¦æ件æ¯âF:\PHP\Application\Home\Controller\IndexController.class.phpâï¼æ件å 容å¦ä¸å¾ï¼
å¨å°åæ è¾å ¥âhttp://localhost/index.phpâï¼å车ï¼çå°çå 容ï¼å°±æ¯è¿ä¸ªæ件ä¸âIndexâå½æ°ä¸çå 容ã
ä¸ã访é®è§å
å°±âhomeâç®å½ä¸çæ§å¶å¨ä¸¾ä¾ï¼æ¨å¯ä»¥éè¿ä»¥ä¸URLå°å访é®ï¼
http://localhost/index.php/Home
http://localhost/index.php/Home/Index
http://localhost/index.php/Home/Index/Index
åãå建第ä¸ä¸ªæ§å¶å¨
å¨âF:\PHP\Applicationâç®å½ä¸æ°å»ºä¸ä¸ªç®å½âIndexâï¼å·ä¸ªèµï¼æâF:\PHP\Application\Homeâç®å½ä¸çå 容é½å¤å¶
å°âF:\PHP\Application\Indexâç®å½ä¸ï¼æå¼âF:\PHP\Application\Index\Controller\IndexController.class.phpâæ件ï¼
为äºç¡®å®è®¿é®çç¡®å®æ¯æ°å çå 容ï¼å¨âIndexâå½æ°ä¸æ·»å ç¹ä¸è¥¿ï¼ä»£ç å¦ä¸ï¼
äºãéè¿ä»¥ä¸URLå°å访é®ï¼
http://localhost/index.php/Index
http://localhost/index.php/Index/Index
http://localhost/index.php/Index/Index/Index
å ãä¿®æ¹æ¯ä¾é ç½®
ThinkPHPçé»è®¤æ¨¡åå称æ¯âHomeâï¼ä¹å°±æ¯è¯´å¦æå¨æµè§å¨å°åæ ä¸è¾å ¥âhttp://localhost/index.phpâçè¯ï¼é»è®¤è®¿é®çæ¯âhttp://localhost/index.php/Homeâã
ä¿®æ¹æ¹æ³ï¼ç¨ææ¬ç¼è¾å·¥å ·æå¼âF:\PHP\ThinkPHP\Conf\convention.phpâæ件ï¼
ä¿®æ¹ç¬¬44è¡ä¸ºï¼'DEFAULT_MODULE' => 'Index', // é»è®¤æ¨¡å