将字符传递到Slim PHP 3路线

发布于 2025-02-02 12:59:56 字数 196 浏览 1 评论 0原文

基本上,我想在细长的路线上使用pas图像名称,但我找不到页面, 但是,如果我从图像名称中摘下点,则可以使用“图像” 来工作的“图像”

$app->get('/images/{imageName}', function($request, $response, $args) {   

这个无法使用slim3

Basicaly I want to pas image name on the Slim route but im getting page not found,
However if i reamove the dot from the image name it works 'image'
this wont work 'image'

$app->get('/images/{imageName}', function($request, $response, $args) {   

Im using Slim3 any idea im new to slim

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瑾夏年华 2025-02-09 12:59:56

我想这是因为文件名包含一个点(。)和其他无效字符,路由器不支持。因此,对于更复杂的参数,最好使用a 查询字符串

示例:

https :: //example.com/images?filename = image.png

I guess this is because a filename contains a dot (.) and other invalid characters, which is not supported by the router. For more complex parameters, it is therefore better to use a query string.

Example:

https:://example.com/images?filename=image.png

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文