Route pattern cannot reference variable name more than once
在用 Laravel Backpack 写一个定制化的 CRUD 页面。例如,一个指定店铺所拥有的商品的 CRUD 页面。
起初路由我是这样写的
CRUD::resource('products-of-store/{store_id}', 'ProductCrudController');
报错
Route pattern "/products-of-store/{store_id}/{{store_id}}" cannot reference variable name "store_id" more than once.
解决方法,Route 调整为
CRUD::resource('store/{store_id}/products', 'ProductCrudController');
即,Route 的最后设置为一个非变量。
出错的原因
我觉得是 resource 会自动将 route 最后的那个单词作为变量,所以出现了报错日志中的变量名重复的问题。
Route pattern cannot reference variable name more than once的更多相关文章
- What are the differences between a pointer variable and a reference variable in C++?
Question: I know references are syntactic sugar, so code is easier to read and write. But what are t ...
- 【ASP.NET MVC 牛刀小试】 URL Route
例子引入 先看看如下例子,你能完全明白吗? using System; using System.Collections.Generic; using System.Linq; using Syste ...
- laravel route路由,视图和response和filter
Laravel充分利用PHP 5.3的特性,使路由变得简单并富于表达性.这使得从构建API到完整的web应用都变得尽可能容易.路由的实现代码在 application/routes.php 文件. 和 ...
- Laravel之路由 Route::get/post/any、路由参数、过滤器、命名、子域名、前缀、与模型绑定、抛出 404 错误、控制器
基本路由 应用中的大多数路都会定义在 app/routes.php 文件中.最简单的Laravel路由由URI和闭包回调函数组成. 基本 GET 路由 代码如下: Route::get('/', fu ...
- FreeBSD Set a Default Route / Gateway
Task: View / Display FreeBSD Routing Table Use netstat command with -r option:$ netstat -r$ netstat ...
- ASP.NET Routing
ASP.NET Routing Other Versions ASP.NET routing enables you to use URLs that do not have to map to ...
- Log4j – Configuring Log4j 2 - Log4j 2的配置
Configuration Inserting log requests into the application code requires a fair amount of planning an ...
- 【ASP.NET MVC系列】浅谈ASP.NET MVC 路由
ASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操作 ...
- 【转】Code Your Own PHP MVC Framework in 1 Hour
原文: https://www.codeproject.com/Articles/1080626/Code-Your-Own-PHP-MVC-Framework-in-Hour --------- ...
随机推荐
- AIC和BIC
一.模型选择之AIC和BIC 人们提出许多信息准则,通过加入模型复杂度的惩罚项来避免过拟合问题,此处我们介绍一下常用的两个模型选择方法 赤池信息准则(Akaike Information Criter ...
- 学习windows编程 day1
#include <windows.h> #include <strsafe.h> /* 任务:去掉标题栏和边框 */ //#define LineHeight 15 这是自己 ...
- windows单机环境下配置tomcat集群
场景:我们在平常联系中,需要涉及到tomcat中,但是电脑不够怎么办,肯定是在自己的电脑上模拟集群,就是装多个tomcat,这时候需要稍微配置下.如果是多个服务器,那不用配置,直接怼!!! 这里介绍的 ...
- Neural Networks and Deep Learning(week4)Deep Neural Network - Application(图像分类)
Deep Neural Network for Image Classification: Application 预先实现的代码,保存在本地 dnn_app_utils_v3.py import n ...
- MySQL数据库中.SQL文件的导出方式
转自:http://tech.watchstor.com/management-117401.htm 在MySQL数据库中导入SQL文件是件很麻烦的事情,但是这是一项大家非常值得学习的技术,本文就从最 ...
- Cmder-控制台模拟器
Cmder是一个软件包,由于在Windows上缺少漂亮的控制台模拟器而纯粹受挫. 它基于令人惊叹的软件,并采用Monokai配色方案和自定义快速布局,从一开始就看起来很性感. 首先,展示一下界面,和W ...
- webkitAnimationEnd事件与webkitTransitionEnd事件
写一个焦点图demo,css3动画完成以后要把它隐藏掉,这里会用到css3的事件,以前没有接触过,结果查了一下发现这是一片新天地啊,而且里面还有好多坑,比如重复动画多次触发什么的.anyway,我还是 ...
- android 使用get和post将数据提交到服务器
1.activity_main.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android& ...
- rest framework错误笔记——身份验证和权限
按照官网教程(http://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/)走到最后一步验证时,命令窗 ...
- day1 查看当前目录命令:pwd
用到查看当前目录的完整路径使用:pwd 物理路径和连接路径什么鬼?没明白暂时借鉴别人的记录下 显示当前目录的物理路径 pwd –P 1: [root@DB-Server init.d]# cd /et ...