CakePHP会话ID路径或其他方法来共享url的结果 - 建议欢迎

我正在寻找关于合理的Cake方法的建议,以创建基于会话ID的网址,我可以与他人分享,以查看我在我看到的相同搜索结果。 我知道在标准的PHP中,我只是获取会话ID并将其传递给url。但我的猜测Cake可能有一种方法或方法来处理这个问题(我猜)。我还没能找到具体的东西。 关于使用Cake方法的最佳方法的任何想法?或者我需要重新发明轮子吗?     
已邀请:
你问这个是因为你正在使用POST,因此URL不包括搜索参数,就像通过GET一样? 我使用以下设计范例来搜索我构建的所有应用程序。 搜索表单提交为POST。 在控制器操作中,如果表单作为帖子提交,我提取搜索参数,然后重定向到包含(命名*)参数的URL。 所以动作代码可能如下所示:
function search() {
    if($this->RequestHandler->isPost()) {
        // let's say we extract parameters called $a and $b here
        $this->redirect(array(
            'action' => 'search',
            'a' => $a,
            'b' => $b
        )
        exit();
    )
    // perform the normal search operation
    // the 'a' and 'b' parameters can be accessed in the $this->params['named']
    // array, automatically extracted by the CakePHP router using the configuration below.
}
关于命名参数,我会在routes.php中设置这个:
Router::connectNamed(array('a', 'b'));
这导致上面的重定向创建一个漂亮,整洁的URL,如:
http://example.com/controller/search/a:FOO/b:BAR
    
我解决了这个问题
search ( ... ) {
    if ($this->RequestHandler->isPost()) {
        $this->Session->write('search_form_sess', $this->data);
        $initial_url = $ApplicantAge . '/' . $SpouseAge . '/' . $NumberChildren . '/' . $Vision . '/' . $Zip;
        $this->redirect(array('action' => 'search', $initial_url));
        exit();
    }
...
}     

要回复问题请先登录注册