尊龙凯时人生就是博

laravelÔõôÐÞ¸ÄĬÈÏ·ÓÉ

laravelÊÇÒ»¿îÊ¢ÐеÄphp¿ò¼Ü£¬ÓÉÓÚÆ侫Á·¡¢¸ßЧ¡¢Ò×ÓõÈÌص㣬±»Ô½À´Ô½¶àµÄ¿ª·¢ÕßËùʹÓá£laravel¿ò¼ÜÖУ¬Â·ÓÉÊÇÒ»¸öºÜÊÇÖ÷ÒªµÄ¿´·¨£¬Í¨¹ý·ÓÉ¿ÉÒÔʵÏÖurlÓë¿ØÖÆÆ÷Ö®¼äµÄÓ³É䣬´Ó¶øʵÏÖwebÓ¦ÓõĹ¦Ð§¡£ÔÚlaravel¿ò¼ÜÖУ¬ÓÐÐí¶àĬÈϵÄ·ÓÉ£¬¿ÉÊÇÕâЩ·Óɲ¢·×Æ綨ÊʺÏÎÒÃǵÄÏîÄ¿£¬Òò´ËÎÒÃÇÐèÒªÐÞ¸ÄĬÈÏ·ÓÉ¡£±¾ÆªÎÄÕ½«Îª¸÷ÈËÏÈÈÝlaravel¿ò¼ÜÖÐÔõÑùÐÞ¸ÄĬÈÏ·ÓÉ¡£

Ò»¡¢ÏàʶLaravel¿ò¼ÜµÄ·ÓÉ¿´·¨

ÔÚLaravel¿ò¼ÜÖУ¬Â·ÓÉÊÇÖ¸½«Ò»¸öURLÇëÇóת·¢¸øÏìÓ¦µÄ¿ØÖÆÆ÷ÒªÁì¾ÙÐд¦ÀíµÄ»úÖÆ¡£LaravelµÄ·ÓɹæÔòͨ³£½ç˵ÔÚroutes/web.phpÎļþÖС£Laravel¿ò¼ÜÌṩÁËÒ»Ì×Ò×ÓõÄ·ÓÉϵͳ£¬ÆäÖаüÀ¨Á˼¸¸ö³£ÓõÄHTTPÇëÇóÒªÁ죬È磺GET¡¢POST¡¢PUT¡¢DELETEµÈ¡£¹ØÓÚÿ¸öHTTPÇëÇóÒªÁ죬Laravel¾ùÌṩÁËÏìÓ¦µÄÏìÓ¦´¦ÀíÒªÁ죬È磺view¡¢json¡¢redirectµÈ¡£

ÔÚLaravel¿ò¼ÜÖУ¬Â·ÓÉͨ³£ÓÉÁ½²¿·Ö×é³É£ºURIºÍ»Øµ÷º¯Êý¡£URIÖ¸»á¼û·ÓÉʱʹÓõÄURL£¬»Øµ÷º¯ÊýÔòÊÇÔÚ»á¼û¶ÔӦ·ÓÉʱËùÖ´ÐеIJÙ×÷¡£ÈôÊÇÏëÒªÉè¼ÆÒ»¸öеķÓÉ£¬Ê×ÏÈÐèÒª½ç˵URI£¬È»ºóÖ¸¶¨´¦Àí¸ÃÇëÇóµÄ¿ØÖÆÆ÷ºÍÒªÁì¡£

¶þ¡¢Laravel¿ò¼ÜÐÞ¸ÄĬÈÏ·ÓɵÄÒªÁì

1.½¨Éè×Ô½ç˵·ÓÉ

Laravel¿ò¼ÜĬÈÏÌṩÁ˼¸¸ö·ÓÉ£¬È磺GET¡¢POST¡¢PUT¡¢DELETEµÈ£¬ÕâЩ¶¼ÊÇÕë¶Ô²î±ðµÄHTTPÇëÇóÒªÁì½ç˵µÄ¡£ÈôÊÇÎÒÃÇÏëÒªÐÞ¸ÄĬÈϵÄ·ÓÉ£¬Ê×ÏÈÐèÒª½¨Éè×Ô½ç˵·ÓÉ¡£

н¨Ò»¸öÃûΪroutes/custom.phpµÄÎļþ£¬´ËÎļþÓÃÓÚ½ç˵×Ô¼ºµÄ·ÓɹæÔò£¬È»ºó½«¸ÃÎļþÒýÈëµ½routes/web.phpÖУ¬ÈçÏ´úÂëËùʾ£º

//routes/custom.php
Route::get('/custom', 'CustomController@index');

µÇ¼ºó¸´ÖÆ

//routes/web.php
require_once __DIR__.'/custom.php';

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊö´úÂëÖУ¬ÎÒÃǽç˵ÁËÒ»¸ö×Ô½ç˵µÄ·ÓÉ/custom£¬¸Ã·Óɽ«»áŲÓÃCustomControllerµÄindex()ÒªÁì¾ÙÐд¦Àí¡£

2.ÐÞ¸ÄLaravelĬÈÏ·ÓÉ

ÈôÊÇÎÒÃÇÏëÒªÐÞ¸ÄLaravel¿ò¼ÜĬÈϵÄ·ÓÉ£¬ÐèÒªÊ×ÏÈÏàʶĬÈÏ·ÓɵĽç˵ºÍ¹æÔò¡£ÔÚLaravel¿ò¼ÜÖУ¬Ò»Ð©Ä¬ÈϵÄ·Óɱ»½ç˵ÔÚapp/Providers/RouteServiceProvider.phpÎļþÖС£ÔÚ¸ÃÎļþÖУ¬ÎÒÃÇ¿ÉÒÔ¿´µ½´ó×ڵķÓɽç˵£¬È磺/login¡¢/registerµÈµÈ¡£

ÈôÊÇÎÒÃÇÏëÒªÐÞ¸ÄÕâЩĬÈÏ·ÓÉ£¬Ö»ÐèÒªÔÚRouteServiceProvider.phpÎļþÖоÙÐÐÐ޸ļ´¿É¡£ÒÔ/loginΪÀý£¬ÎÒÃÇ¿ÉÒÔ½«µÇ¼·Óɱ任Ϊ/login-page£¬´úÂëÈçÏÂËùʾ£º

//app/Providers/RouteServiceProvider.php
public const HOME = '/home';

//Auth::routes();    
Route::get('/login-page', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('/login', 'Auth\LoginController@login');

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊö´úÂëÖУ¬ÎÒÃÇ×¢Ê͵ôÁËÔ­ÓеÄAuth::routes()ÒªÁ죬Ȼºóн¨ÁËÒ»¸öÃûΪ/login-pageµÄ·ÓÉ£¬¸Ã·Óɽ«»áŲÓÃAuth/LoginControllerµÄshowLoginForm()ÒªÁì¾ÙÐд¦Àí¡£

Èý¡¢×ܽá

Laravel¿ò¼ÜÖеÄ·ÓÉϵͳÊÇʵÏÖWebÓ¦ÓõÄÖ÷Òª×é³É²¿·Ö¡£ÐÞ¸ÄĬÈÏ·ÓÉÊÇÏîÄ¿¿ª·¢Öг£¼ûµÄÐèÇ󣬱¾ÎÄͨ¹ýÏÈÈݽ¨Éè×Ô½ç˵·ÓɺÍÐÞ¸ÄĬÈÏ·ÓɵÄÒªÁ죬ϣÍûÄÜ×ÊÖú¸÷È˸üºÃµØÃ÷È·Laravel¿ò¼ÜÖеÄ·ÓÉ¿´·¨ºÍʹÓá£

ÒÔÉϾÍÊÇlaravelÔõôÐÞ¸ÄĬÈÏ·ÓɵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

13452372176

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

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

QR code
sitemap¡¢ÍøÕ¾µØͼ