laravelÖг¬Á´½ÓÔõôÓÃ
laravelÊÇÒ»ÖÖÊ¢ÐеÄphp¿ò¼Ü£¬ËüÌṩÐí¶à±ã½ÝµÄÒªÁìºÍ¹¦Ð§À´¿ª·¢webÓ¦ÓóÌÐò¡£³¬Á´½ÓÊÇwebÓ¦ÓóÌÐòÖÐÖ÷ÒªµÄÒ»²¿·Ö£¬Ëü¿ÉÒÔÈÃÓû§ÔÚ²î±ðµÄÒ³ÃæÖ®¼ä¾ÙÐе¼º½¡£ÔÚlaravelÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃÐí¶à·½·¨À´½¨É賬Á´½Ó£¬ÏÂÃæÎÒÃǾÍÀ´ÏêϸÏàʶһÏ¡£
ʹÓÃHTML·½·¨
ÔÚLaravelÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃHTML³¬Á´½Ó±êÇ©À´½¨É賬Á´½Ó¡£ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄʾÀý£¬Ëü½«»á½¨ÉèÒ»¸ö³¬Á´½Óµ½GoogleµÄÊ×Ò³£º
<a href="https://www.google.com">Google</a>
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄ´úÂëÖУ¬ÎÒÃÇʹÓÃÁ˱êÇ©À´½ç˵³¬Á´½Ó¡£hrefÊôÐÔÖ¸¶¨ÁËÒªÁ´½ÓµÄURLµØµã£¬ÆäÖÐhttps://www.google.com´ú±íÁËÎÒÃÇÒªÁ´½ÓµÄµØµã¡£ÔÚ±êÇ©Ö®¼ä£¬ÎÒÃÇ¿ÉÒÔ·ÅÈëÎÒÃÇÏëÒªÏÔʾµÄÎı¾£¬ÀýÈçGoogle¡£
³ýÁËURLµØµãÍ⣬ÎÒÃÇ»¹¿ÉÒÔÉèÖÃÆäËûÊôÐÔ£¬ÈçtargetÊôÐÔÀ´Ö¸¶¨Á´½ÓµÄ·¿ª·½·¨¡£ÀýÈ磬ÈôÊÇÎÒÃÇÏëÔÚд°¿ÚÖз¿ªGoogleÍøÕ¾£¬¿ÉÒÔʹÓÃÒÔÏ´úÂ룺
<a href="https://www.google.com" target="_blank">Google</a>
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄ´úÂëÖУ¬ÎÒÃÇÌí¼ÓÁËtarget=”_blank”ÊôÐÔÀ´Ö¸¶¨Á´½ÓÔÚд°¿ÚÖз¿ª¡£ÕâÑù£¬µ±Óû§µã»÷Á´½Óʱ£¬GoogleÍøÕ¾½«ÔÚеÄä¯ÀÀÆ÷´°¿ÚÖз¿ª¡£
ʹÓÃroute()º¯Êý
ÔÚLaravelÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃroute()º¯ÊýÀ´½¨É賬Á´½Ó¡£¸Ãº¯Êý¿ÉÒÔƾ֤·ÓɵÄÃû³Æ»òÇëÇ󷾶ÌìÉúÁ´½Ó¡£ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄʾÀý£º
<a href="{{ route('home') }}">Home</a>
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄ´úÂëÖУ¬ÎÒÃÇʹÓÃÁËroute()º¯ÊýÀ´ÌìÉúµ½Â·ÓÉÃû³ÆΪhomeµÄURLµØµãµÄ³¬Á´½Ó¡£
ÀàËƵأ¬ÎÒÃÇ»¹¿ÉÒÔʹÓÃroute()º¯ÊýÀ´ÌìÉúÖ¸Ïò¿ØÖÆÆ÷ºÍÒªÁìµÄÁ´½Ó¡£ÒÔÏÂÊÇÒ»¸öʾÀý£¬ËüʹÓÃÁËroute()º¯ÊýºÍ¿ØÖÆÆ÷µÄÃû³ÆºÍÒªÁìÀ´ÌìÉú³¬Á´½Ó£º
<a href="{{ route('user.show', $user->id) }}">View User</a>
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄ´úÂëÖУ¬ÎÒÃÇʹÓÃÁËroute()º¯ÊýÀ´ÌìÉúÁ´½Óµ½UserController¿ØÖÆÆ÷ÖеÄshow()ÒªÁìµÄ³¬Á´½Ó¡£ÎÒÃÇ»¹×ª´ïÁËÒ»¸öÃûΪ$userµÄ¹¤¾ß£¬¸Ã¹¤¾ß°üÀ¨ÁËÒªÏÔʾÐÅÏ¢µÄÓû§ID¡£
ʹÓÃURL()º¯Êý
ÔÚLaravelÖУ¬ÎÒÃÇ»¹¿ÉÒÔʹÓÃURL()º¯ÊýÀ´½¨É賬Á´½Ó¡£¸Ãº¯Êý¿ÉÒÔƾ֤ÇëÇ󷾶ÌìÉúÁ´½Ó¡£ÒÔÏÂÊÇÒ»¸ö¼òÆÓµÄʾÀý£º
<a href="{{ URL('/about-us') }}">About Us</a>
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄ´úÂëÖУ¬ÎÒÃÇʹÓÃÁËURL()º¯ÊýÀ´ÌìÉúµ½/about-us·¾¶µÄ³¬Á´½Ó¡£
ÀàËÆÓÚʹÓÃroute()º¯Êý£¬ÎÒÃÇ¿ÉÒÔʹÓÃURL()º¯ÊýÌìÉú¿ØÖÆÆ÷ºÍÒªÁìµÄÁ´½Ó¡£ÒÔÏÂÊÇÒ»¸öʾÀý£¬ËüʹÓÃÁËURL()º¯ÊýºÍ¿ØÖÆÆ÷µÄÃû³ÆºÍÒªÁìÀ´ÌìÉú³¬Á´½Ó£º
<a href="{{ URL('user/' . $user->id . '/edit') }}">Edit User</a>
µÇ¼ºó¸´ÖÆ
ÔÚÉÏÃæµÄ´úÂëÖУ¬ÎÒÃÇʹÓÃÁËURL()º¯ÊýÀ´ÌìÉúµ½UserController¿ØÖÆÆ÷ÖеÄedit()ÒªÁìµÄ³¬Á´½Ó¡£ÎÒÃÇ»¹×ª´ïÁËÒ»¸öÃûΪ$userµÄ¹¤¾ß£¬¸Ã¹¤¾ß°üÀ¨ÁËÒª±à¼µÄÓû§ID¡£
×ܽá
ÒÔÉÏÊÇÔÚLaravelÖÐʹÓó¬Á´½ÓµÄÒªÁì¡£ÎÞÂÛÊÇʹÓÃHTML±êÇ©£¬ÕÕ¾ÉʹÓÃLaravelµÄroute()º¯Êý»òURL()º¯Êý£¬ÎÒÃǶ¼¿ÉÒÔºÜÀû±ãµØ½¨É賬Á´½ÓÀ´¹¹½¨×ðÁú¿Ê±WebÓ¦ÓóÌÐò¡£ÔÚÏÖʵ¿ª·¢ÖУ¬ÎÒÃÇÐèҪƾ֤ÏÖʵÐèÇóÀ´Ñ¡ÔñÊʺϵij¬Á´½Ó·½·¨À´¾ÙÐпª·¢¡£
ÒÔÉϾÍÊÇlaravelÖг¬Á´½ÓÔõôÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡