久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Cake PHP 重定向在 url 中帶有參數

Cake PHP redirect with parameters in url(Cake PHP 重定向在 url 中帶有參數)
本文介紹了Cake PHP 重定向在 url 中帶有參數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個頁面,我想重定向到它需要 URL 中的參數:http://www.example.com/myController/myAction/param1:val1/param2:val2

我知道有一個用于重定向的 CakePHP 重定向函數,其工作方式如下:

 $this->redirect(array("controller" => "myController",動作" =>"我的行動",$data_can_be_passed_here),$status, $exit);

如何使用上述函數添加我想要的參數作為 url 的一部分?

我認為可能還有另一個元素可以添加到數組中,以便我可以傳遞 param1:val1param2:val2.

任何幫助將不勝感激!

解決方案

我不知道為什么我無法在 CakePHP 文檔中找到這個,但我終于找到了解決方案.我把它貼在這里以防其他人有同樣的問題.(如果有人知道這是在文檔中的哪個位置,也請貼出來,謝謝!)

重定向到 URL:

http://www.example.com/myController/myAction/param1:val1/param2:val2

您可以使用:

<塊引用>

$this->redirect(array("controller" => "myController",動作" =>"我的行動",參數 1" =>"val1",參數 2" =>"val2",$data_can_be_passed_here),$狀態,$退出);

希望能幫到你!

I have a page that I want to redirect to that requires parameters in the URL: http://www.example.com/myController/myAction/param1:val1/param2:val2

I know that there is a CakePHP redirect function for redirecting that works as follows:

 $this->redirect(array("controller" => "myController",
                       "action" => "myAction",
                       $data_can_be_passed_here),
                 $status, $exit);

How do I add the parameters that I want as part of the url using the above function?

I would think that there might be another element that I could add to array so that I can pass along param1:val1 and param2:val2.

Any help would be greatly appreciated!

解決方案

I do not know why I was not able to find this in the CakePHP documentation, but I did finally figure out the solution. I am posting it here in case anyone else has the same problem. (If someone knows where this is in the documentation please post it as well, thanks!)

To redirect to the URL:

http://www.example.com/myController/myAction/param1:val1/param2:val2

You can use:

$this->redirect(array("controller" => "myController", 
                      "action" => "myAction",
                      "param1" => "val1",
                      "param2" => "val2",
                      $data_can_be_passed_here),
                $status,
                $exit);

Hope it helps!

這篇關于Cake PHP 重定向在 url 中帶有參數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cannot use #39;Object as class name as it is reserved Cake 2.2.x(不能使用 Object 作為類名,因為它是保留的 Cake 2.2.x)
Session is lost after an OAuth redirect(OAuth 重定向后會話丟失)
Pagination Sort in Cakephp 3.x(Cakephp 3.x 中的分頁排序)
CakePHP Shared core for multiple apps(CakePHP 多個應用程序的共享核心)
Login [ Auth-gt;identify() ] always false on CakePHP 3(在 CakePHP 3 上登錄 [ Auth-identify() ] 始終為 false)
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 87 bytes)(致命錯誤:允許的內存大小為 134217728 字節已用盡(嘗試分配 87 字節))
主站蜘蛛池模板: 久久午夜精品 | 色性av| 国产在线不卡视频 | 日日爱视频 | 免费 视频 1级| 免费视频二区 | 欧美黄色一级毛片 | 成年人网站在线观看视频 | 成人精品一区二区三区中文字幕 | 黄色欧美在线 | 亚洲综合免费 | 午夜影院| 久久久精品视频一区二区三区 | 色婷婷综合在线观看 | 国产精品久久一区二区三区 | 精品久久中文字幕 | 黄色欧美大片 | 草久久 | 日韩欧美手机在线 | 国户精品久久久久久久久久久不卡 | 视频一区二区在线观看 | 殴美成人在线视频 | 亚洲国产精品成人无久久精品 | 中文字幕一区二区三区日韩精品 | 91麻豆精品国产91久久久久久 | 看片国产| 在线免费观看成人 | 久久69精品久久久久久久电影好 | 亚洲色视频 | 欧美精品久久久久 | 精品一区二区不卡 | 久久久久久久网 | 日韩爱爱网 | 亚洲成人日韩 | 狠狠影院 | 国产成人在线视频 | 国产日韩一区 | 日韩中文字幕视频 | a级毛片基地| 国产一区二区 | 91天堂网|