×ðÁú¿­Ê±¹ÙÍøµÇ¼

thinkphp¶àÓïÑԵǼ¹ýʧ

Ëæ×ÅÈ«Çò»¯µÄÉú³¤ £¬¶àÓïÑÔÒѾ­³ÉΪÁËÍøÕ¾¿ª·¢Öв»¿É»òȱµÄÒ»²¿·Ö¡£ÔÚ¿ª·¢Àú³ÌÖÐ £¬ÎÒÃǾ­³£ÐèҪΪÍøÕ¾Ìí¼Ó¶àÓïÑÔÖ§³Ö¡ £¿ª·¢Öо­³ £»áÓõ½php¿ò¼Üthinkphp £¬È»¶ø £¬¿ª·¢ÖкܿÉÄÜ»áÓöµ½thinkphp¶àÓïÑԵǼ¹ýʧµÄÎÊÌâ¡£±¾ÎĽ«ÏêϸÌÖÂÛÕâ¸öÎÊÌâ¡£

Ê×ÏÈ £¬ÈÃÎÒÃÇÀ´¿´¿´ÎÊÌâµÄÏêϸÇéÐΡ£¼ÙÉèÎÒÃǵÄÍøÕ¾ÐèÒªÖ§³ÖÖÐÎĺÍÓ¢ÎÄÓïÑÔ £¬²¢ÇÒÔڵǼҳÃæ±£´æÓïÑÔÇл»¹¦Ð§¡£µ±ÎÒÃÇÇл»ÖÁÓ¢ÎÄÓïÑÔ £¬ÊäÈë׼ȷµÄÓû§ÃûºÍÃÜÂë £¬¿ÉÊÇÈ´ÎÞ·¨ÀֳɵǼ¡£´Ëʱ £¬ÎÒÃÇÖ´ÐÐÒÔϵ÷ÊÔ²½·¥£º

1.¼ì²éÉèÖÃÎļþ

ÎÒÃÇ¿ÉÒÔÊ×Ïȼì²éconfigÎļþÖеÄÓïÑÔÉèÖÃÊÇ·ñ׼ȷ¡£ÆäÖÐ £¬ºÜ¿ÉÄÜ»áÓÐÒÔÏÂÁ½¸öÉèÖãº

'lang_switch_on' => true, //ÊÇ·ñ¿ªÆô¶àÓïÑÔÇл»¹¦Ð§
'lang_auto_detect' => true, //ÊÇ·ñ¿ªÆô×Ô¶¯¼ì²âÓïÑÔ

µÇ¼ºó¸´ÖÆ

¹ØÓÚµÚÒ»¸öÉèÖÃÏî £¬ÎÒÃÇÐèҪȷ±£¸ÃÏîΪtrue £¬²Å»ªÕý³£Ê¹ÓöàÓïÑÔÇл»¹¦Ð§¡£¹ØÓÚµÚ¶þ¸öÉèÖÃÏî £¬ÎÒÃÇÐèҪƾ֤ÇéÐξÙÐÐÉèÖá£ÈôÊÇÏ£ÍûÔÚÓû§»á¼ûʱ×Ô¶¯¼ì²âÓû§ÓïÑÔ £¬ÎÒÃÇÐèÒª½«¸ÃÏîÉèÖÃΪtrue¡£ÈôÊÇÏ£Íûͨ¹ý²ÎÊý»òcookieµÈ·½·¨ÊÖ¶¯ÉèÖÃÓïÑÔ £¬ÔòÐèÒª½«¸ÃÏîÉèÖÃΪfalse¡£

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡± £»

2.¼ì²éÓïÑÔÎļþ

ÎÒÃÇ»¹ÐèÒª¼ì²éÔÚÇл»ÖÁÓ¢ÎÄÓïÑÔʱ £¬ÓïÑÔÎļþÖÐÊÇ·ñ°üÀ¨Á˵ǼÏà¹ØµÄ·­Òë¡£ÈôÊÇûÓÐ £¬ÔòÐèÒªÌí¼Ó·­ÒëÄÚÈÝ¡£

3.¼ì²éÓïÑÔÇл»Á´½ÓÊÇ·ñ׼ȷ

µ±ÎÒÃÇʵÏÖÁËÓïÑÔÇл»¹¦Ð§ºó £¬ÐèҪȷ±£ÔÚÇл»Ê± £¬ÌøתÁ´½ÓÊÇ·ñ׼ȷ¡£ÏêϸÀ´Ëµ £¬ÎÒÃÇÐèҪȷ±£ÔÚÇл»ÖÁÓ¢ÎÄÓïÑÔʱ £¬ÌøתÁ´½ÓÖÐÓ¦¸Ã°üÀ¨ÒÔÏÂÄÚÈÝ£º

?l=en-us

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬en-usÌåÏÖÓ¢ÎÄÓïÑÔ¡£ÈôÊÇÁ´½ÓÖÐûÓаüÀ¨¸Ã²ÎÊý £¬ÔòÐèÒª¾ÙÐÐÌí¼Ó¡£

ÒÔÉÏÈý¸ö°ì·¨¶¼Ã»Óз¢Ã÷ÎÊÌâ £¬¿ÉÊÇÎÒÃÇÈÔÈ»ÎÞ·¨µÇ¼Àֳɡ£´Ëʱ £¬ÎÒÃÇÐèÒªÉîÈë¾ÙÐе÷ÊÔ¡£

4.µ÷ÊÔMySQLÓï¾ä

µÇ¼¹¦Ð§µÄʵÏÖͨ³£ÐèÒªºÍÊý¾Ý¿â½»»¥ £¬ÎÒÃÇÐèÒª¼ì²éÊÇ·ñ±£´æSQLÓï¾ä¹ýʧ¡£¹ØÓÚÐèҪ˫ÓïÖ§³ÖµÄϵͳ £¬ÎÒÃÇÐèÒªÔÚSQLÅÌÎÊÓï¾äÖмÓÈëLANG±äÁ¿À´Çø·Ö²î±ðµÄÓïÖÖ¡£¹ØÓÚthinkphp¿ò¼Ü £¬ÎÒÃÇÐèÒªÔÚModelÀàµÄ½á¹¹º¯ÊýÖÐÉèÖÃĬÈÏÓïÑÔ¡£

protected $defaultLang = 'zh-cn'; //ÖÐÎÄÓïÑÔ

µÇ¼ºó¸´ÖÆ

5.¼ì²ésessionµÄ¿ªÆô

×îºó £¬ÎÒÃÇÐèÒª¼ì²ésessionµÄ¿ªÆôÇéÐÎ £¬ÓÉÓÚÔڵǼ¹¦Ð§ÖÐ £¬ÎÒÃÇÐèҪʹÓÃsessionÀ´ÉúÑÄÓû§×´Ì¬¡£ÈôÊÇsessionûÓÐÕý³ £¿ªÆô £¬¾Í»áµ¼ÖµÇ¼¹ýʧ¡£

ÒÔÉϾÍÊÇÔÚthinkphp¿ò¼ÜÖзºÆð¶àÓïÑԵǼ¹ýʧµÄ¿ÉÄÜÔµ¹ÊÔ­Óɼ°½â¾ö¼Æ»®¡£²î±ðµÄÍøÕ¾ºÍÓ¦Óó¡¾°¿ÉÄܻᱣ´æÆäËûÎÊÌâ £¬ÐèÒªÕë¶ÔÏêϸÇéÐξÙÐе÷ÊÔ¡£ÔÚ¾ÙÐе÷ÊÔʱ £¬ÎÒÃÇÐèҪעÖØϸ½Ú £¬²¢ÇÒʵʱ¼Í¼µ÷ÊÔÀú³ÌÖÐËù±¬·¢µÄ¹ýʧÐÅϢϢÕù¾ö¼Æ»® £¬ÒÔ±ãÓÚºóÐøµÄ¿ª·¢ºÍά»¤ÊÂÇé¡£

ÒÔÉϾÍÊÇthinkphp¶àÓïÑԵǼ¹ýʧµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ