将字符传递到Slim PHP 3路线
基本上,我想在细长的路线上使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想这是因为文件名包含一个点(。)和其他无效字符,路由器不支持。因此,对于更复杂的参数,最好使用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