Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人知道,如何在控制器之外获取 url 数组参数(例如 bootstrap.php)?
CakePHP 归根结底仍然是 PHP,因此您可以使用任何有效的 PHP 方法来实现这一点。喜欢:
if (!empty($_SERVER['QUERY_STRING'])) { // A querystring was set... }
或者
$url = parse_url($_SERVER['REQUEST_URI']); if (!empty($url['query'])) { // A querystring was set... }
之后你可以做任何你想做的事情。