尊龙凯时人生就是搏

ÔõÑùÔÚthinkphpÖÐʵÏÖÌøתµ½ÁíÒ»¸öÒªÁì

ÔÚʹÓÃphp¿ò¼Üthinkphp¾ÙÐпª·¢Ê±£¬ÓÐʱ¼äÎÒÃÇÐèÒªÔÚÒ»¸öÒªÁìÖÐÌøתµ½ÁíÒ»¸öÒªÁì¡£ÕâÖÖÇéÐÎÔÚÏÖʵ¿ª·¢ÖзǾ­³£¼û¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚthinkphpÖÐʵÏÖÌøתµ½ÁíÒ»¸öÒªÁì¡£

Ê×ÏÈ£¬ÎÒÃÇÐèÒªÏàʶthinkphpÖеÄ·ÓÉ¿´·¨¡£thinkphp½ÓÄÉ·ÓÉ»úÖÆÀ´´¦ÀíÇëÇó£¬Â·ÓÉ»úÖÆÈÏÕ潫Óû§ÇëÇóÓ³Éäµ½¶ÔÓ¦µÄ¿ØÖÆÆ÷ÒªÁì¡£

ÔÚthinkphpÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýURLµØµãÀ´»á¼û¿ØÖÆÆ÷µÄÒªÁ죬ͨ³£µÄURLµØµãÃûÌÃΪ£º

http:////

µÇ¼ºó¸´ÖÆ

ÀýÈ磬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏÂURLµØµã»á¼û¿ØÖÆÆ÷IndexµÄÒªÁìhello£º

http://example.com/index/hello

µÇ¼ºó¸´ÖÆ

ÔÚthinkphpÖУ¬ÒªÌøתµ½ÁíÒ»¸öÒªÁ죬ÎÒÃÇ¿ÉÒÔʹÓÃredirectº¯Êý¡£Õâ¸öº¯ÊýµÄ×÷ÓÃÊǽ«ÇëÇóÖض¨Ïòµ½Ö¸¶¨µÄURLµØµã»ò·Óɵصã¡£

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

ÕâÀïÐèҪעÖصÄÊÇ£¬ÈôÊÇÎÒÃÇÒªÌøתµ½Ä¿½ñ¿ØÖÆÆ÷µÄÁíÒ»¸öÒªÁ죬ÎÒÃÇ¿ÉÒÔÖ±½ÓʹÓÿØÖÆÆ÷ÒªÁìµÄÃû³Æ×÷Ϊ·Óɵصã¡£ÀýÈ磬¿ØÖÆÆ÷IndexÖÐÓÐÒ»¸öÒªÁìtest£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÒÔÏ´úÂ뽫ÇëÇóÖض¨Ïòµ½¸ÃÒªÁ죺

$this->redirect('test');

µÇ¼ºó¸´ÖÆ

µ±ÎÒÃÇʹÓÃ$this->redirect(‘test’)ʱ£¬thinkphp»á×Ô¶¯½«test×÷Ϊ·Óɵص㣬ȻºóÖ´ÐпØÖÆÆ÷IndexµÄÒªÁìtest¡£

ÈôÊÇÎÒÃÇÒªÌøתµ½ÆäËû¿ØÖÆÆ÷µÄÒªÁ죬ÎÒÃÇÐèҪʹÓÃÍêÕûµÄ·Óɵصã¡£ÀýÈ磬ҪÌøתµ½¿ØÖÆÆ÷UserµÄÒªÁìlogin£¬ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏ´úÂ룺

$this->redirect('user/login');

µÇ¼ºó¸´ÖÆ

ÕâÀïµÄuserÊÇ¿ØÖÆÆ÷Ãû£¬loginÊÇÒªÁìÃû¡£thinkphp»áƾ֤·ÓɵصãÖ´ÐжÔÓ¦µÄ¿ØÖÆÆ÷µÄÒªÁì¡£

³ýÁËÖ¸¶¨ÍêÕûµÄ·Óɵص㣬ÎÒÃÇ»¹¿ÉÒÔʹÓÃÊý×éÀ´½ç˵·Óɵصã¡£ÀýÈ磬ҪÌøתµ½¿ØÖÆÆ÷UserµÄÒªÁìlist£¬ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏ´úÂ룺

$this->redirect(['user/list']);

µÇ¼ºó¸´ÖÆ

ʹÓÃÊý×éµÄ·½·¨¿ÉÒÔÔ½·¢ÎÞаµØ½ç˵·Óɵص㣬¿ÉÒÔת´ï¸ü¶àµÄ²ÎÊýÐÅÏ¢¡£

ÔÚÏÖʵ¿ª·¢ÖУ¬ÎÒÃÇÒ²ºÜÈÝÒ×·ºÆðÐèҪת´ï²ÎÊýµ½ÌøתµÄÒªÁìÖеÄÇéÐΡ£ÔÚthinkphpÖУ¬ÎÒÃÇ¿ÉÒÔʹÓñäÁ¿À´×ª´ï²ÎÊý¡£ÀýÈ磬ÎÒÃÇÒªÌøתµ½¿ØÖÆÆ÷UserµÄÒªÁìdetail£¬²¢ÇÒ´øÉϲÎÊýid=1£¬ÎÒÃÇ¿ÉÒÔʹÓÃÒÔÏ´úÂ룺

$id = 1;
$this->redirect('user/detail', ['id' => $id]);

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊö´úÂëÖУ¬ÎÒÃÇÊ×ÏȽç˵ÁËÒ»¸ö$id±äÁ¿£¬¸Ã±äÁ¿µÄֵΪ1¡£È»ºóÎÒÃÇʹÓÃ$this->redirect(‘user/detail’, [‘id’ => $id])½«ÇëÇóÖض¨Ïòµ½¿ØÖÆÆ÷UserµÄÒªÁìdetail£¬²¢ÇÒת´ïÁËÒ»¸ö²ÎÊýid£¬ÆäֵΪ±äÁ¿$idµÄÖµ¡£

ÔÚÌøתʱ£¬ÎÒÃÇ»¹¿ÉÒÔÖ¸¶¨ÌøתµÄ·½·¨¡£thinkphpÖ§³ÖÒÔÏÂÌøת·½·¨£º

Ò³ÃæÌøת£¨Ä¬ÈÏ£©£ºÊ¹ÓÃ301»ò302״̬Â룬ä¯ÀÀÆ÷»á×Ô¶¯Ìøתµ½Ö¸¶¨µÄURLµØµã¡£

AJAXÌøת£ºÊ¹ÓÃJSONÃûÌ÷µ»ØÌøתµØµã£¬ÓÉÇ°¶Ë×ÔÐÐÌøת¡£

Öض¨Ïò£ºÊ¹ÓÃHTTP״̬Âë302ÔÚЧÀÍÆ÷¶Ë½«ÇëÇóÖض¨Ïòµ½Ö¸¶¨µÄURLµØµã¡£

ÈôÊDz»Ö¸¶¨Ìøת·½·¨£¬thinkphp½«Ä¬ÈÏʹÓÃÒ³ÃæÌøת¡£

×ܽ᣺

ÔÚthinkphpÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýredirectº¯Êý¾ÙÐÐÌøתµ½ÁíÒ»¸öÒªÁì¡£ÎÒÃÇ¿ÉÒÔʹÓÿØÖÆÆ÷ÒªÁìµÄÃû³Æ×÷Ϊ·Óɵص㣬Ҳ¿ÉÒÔʹÓÃÍêÕûµÄ·Óɵصã¡£ÔÚÌøתʱ£¬ÎÒÃÇ»¹¿ÉÒÔת´ï²ÎÊý£¬²¢ÇÒ¿ÉÒÔÖ¸¶¨Ìøת·½·¨¡£×£¸÷ÈËÔÚthinkphp¿ª·¢ÖÐÄܹ»Ë³ËìʵÏÖÌøתµ½ÁíÒ»¸öÒªÁì¡£

ÒÔÉϾÍÊÇÔõÑùÔÚthinkphpÖÐʵÏÖÌøתµ½ÁíÒ»¸öÒªÁìµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

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