ÔõÑùÐÞ¸ÄThinkPHP 5.0ºǫ́ÖÎÀíµØµã
thinkphpÊÇÒ»¿î»ùÓÚphpµÄ¿ìËÙ¿ª·¢¿ò¼Ü£¬ÆÕ±éÓ¦ÓÃÓÚweb¿ª·¢ÖС£ÔÚʹÓÃthinkphp 5.0µÄÀú³ÌÖУ¬ÎÒÃÇ¿ÉÄÜÐèÒªÐ޸ĺǫ́ÖÎÀíµØµãÒÔÌá¸ßÍøÕ¾µÄÇå¾²ÐÔ¡£±¾ÎĽ«Îª¸÷È˽â˵ÔõÑùÐÞ¸Äthinkphp 5.0ºǫ́ÖÎÀíµØµã¡£
·¿ªconfigÎļþ¼Ð
ÔÚThinkPHP 5.0µÄÏîÄ¿ÖУ¬·¿ªconfigÎļþ¼Ð£¬¿ÉÒÔ¿´µ½ÓÐÒ»¸öÃûΪroute.phpµÄÎļþ¡£
·¿ªroute.phpÎļþ
ÔÚroute.phpÎļþÖУ¬ÎÒÃÇ¿ÉÒÔÌí¼Ó·ÓɹæÔòÀ´Ð޸ĺǫ́ÖÎÀíµØµã¡£Ê×ÏÈ£¬ÎÒÃÇÐèҪʹÓÃRoute::rule()º¯ÊýÀ´½¨ÉèÒ»¸ö·ÓɹæÔò¡£
ÀýÈ磬ÎÒÃÇÐèÒª°Ñºǫ́ÖÎÀíµØµãÐÞ¸ÄΪ¡°/admin_login¡±£¬¿ÉÒÔʹÓÃÏÂÃæµÄ´úÂ룺
Route::rule('admin_login', 'admin/Index/login');
µÇ¼ºó¸´ÖÆ
ÕâÀ¡°admin_login¡±ÌåÏÖеÄÖÎÀíµØµã£¬¡°admin/Index/login¡±ÌåÏÖÔÓеÄÖÎÀíµØµã¡£ÕâÒ»ÐдúÂëµÄ×÷ÓþÍÊǽ«ÔÓеÄÖÎÀíµØµãÓ³Éäµ½¡°admin_login¡±µØµãÉÏ¡£
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
ÉúÑÄÐ޸IJ¢²âÊÔ
ÐÞ¸ÄÍê±Ïºó£¬½«route.phpÎļþÉúÑÄ¡£ÔÚä¯ÀÀÆ÷ÖÐÊäÈë¡°http://ÏîÄ¿µØµã/admin¡±£¬Ó¦¸Ã»á¿´µ½Ò³ÃæÎÞ·¨»á¼ûµÄÌáÐÑ¡£ÕâÊÇÓÉÓÚÎÒÃÇÒѾ½«ºǫ́ÖÎÀíµØµãÐÞ¸ÄΪ¡°/admin_login¡±£¬ÐèҪʹÓÃеصã»á¼û¡£
ÊäÈë¡°http://ÏîÄ¿µØµã/admin_login¡±£¬ÈôÊÇ¿ÉÒÔÀֳɻá¼ûµ½ºǫ́µÇ¼ҳÃ棬˵Ã÷ÐÞ¸ÄÀֳɡ£
×¢ÖØ£ºÈôÊÇʹÓÃÁË×ÓÓòÃû»òÕ߶þ¼¶Ä¿Â¼£¬ÐèÒª¶Ô·ÓɹæÔò¾ÙÐÐÏìÓ¦µÄµ÷½â¡£
×ܽá
ͨ¹ýÒÔÉÏ°ì·¨£¬ÎÒÃÇ¿ÉÒÔÇáËɵØÐÞ¸ÄThinkPHP 5.0µÄºǫ́ÖÎÀíµØµã£¬Ìá¸ßÍøÕ¾µÄÇå¾²ÐÔ¡£ÔÚÏÖʵÏîÄ¿ÖУ¬ÎÒÃÇ»¹¿ÉÒÔÍŽáÆäËûÇå¾²²½·¥À´½øÒ»²½±£»¤ÍøÕ¾µÄÇå¾²¡£
ÒÔÉϾÍÊÇÔõÑùÐÞ¸ÄThinkPHP 5.0ºǫ́ÖÎÀíµØµãµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡