我想要使用cakephp的以下類型的URL。json格式的cakephp url參數
http://localhost/project1/controller1/action1/[{"user_id":"1","udid":"","msg":"","nick_n":"Danis","post_t":"2011-10-21 12:15:00","source":"A"}]/50
其中[{"user_id":"1","udid":"","msg":"","nick_n":"Danis","post_t":"2011-10-21 12:15:00","source":"A"}]
和50是參數。
我在/app/config/routes.php文件中寫了以下代碼行。
Router::connect('/controller/action/*', array('controller' => 'controller1', 'action1' => 'actionName'));
但是,當我調試上面的URL,我沒有得到json格式的參數。
這是我的行爲。
function action1($arg1 = NULL, $arg2 = NULL) {
// I am getting 50 in $arg1 and $arg2 = NULL.
}
請告訴我,我是否錯過了這裏。我沒有在$ arg1中獲得json格式的參數。
謝謝。