【发布时间】:2016-11-19 04:58:43
【问题描述】:
我有一个脚本代码将重定向到
http://localhost:8080/generated/sample/ + $('form.wpcf7-form').serialize();
并且生成的示例 url 是
http://localhost:8080/generated/sample/_wpcf7=222&_wpcf7_version=4.5.1&_wpcf7_locale=en_US&_wpcf7_unit_tag=wpcf7-f222-p37-o1&_wpnonce=35162dc550&your-name=Robert+Soriano&your-email=sorianorobertc%40gmail.com&mobile-number=39174535417
序列化值来自WordPress的Contact Form 7插件。
在我的苗条路线中,我有
<?php
// Routes
$app->get('/{name}', function ($request, $response, $args) {
// Sample log message
$this->logger->info("Slim-Skeleton '/' route");
// Render index view
return $this->renderer->render($response, 'index.phtml', $args);
});
$app->get('/generated/sample/', function ($request, $response, $args) {
return $args['your-email'];
// How to access different parameters here?
});
我得到的是这个
就像第一条路线正在为此工作,但不是我想要的路线。
如何在我的路由中访问这些参数,例如姓名、电子邮件以及所有这些参数?
任何帮助将不胜感激。
【问题讨论】: