[sonata admin] argument "$code" of method
按照这里,在 AppBundle中的Controller创建了 CategoryAdmin 类,当运行
php bin/console server:start
出现
Cannot autowire service "AppBundle\Controller\CategoryAdmin": argument "$code" of method "Sonata\AdminBundle\Admin\AbstractAdmin::__construct()" has no
type-hint, you should configure its value explicitly.
通过搜索资料,找到 Empty Dashboard Symfony3 sonata adminBundle 最后比对才发现,需要把 src/AppBundle/Controller/CategoryAdmin.php 放入到 src/AppBundle/Admin/CategoryAdmin.php ,
然后再运行 php bin/console server:start 就启动成功了
最终的效果

[sonata admin] argument "$code" of method的更多相关文章
- The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
如果你是通过搜索来到本文的,相信你应该是遇到了如下的错误 The code of method _jspService(HttpServletRequest, HttpServletResponse) ...
- Tomcat 解决The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
解法: 修改tomcat下的web.xml, 搜索:JspServlet, 增加: <init-param> <param-name>mappedfile</pa ...
- Status Code:405 Method Not Allowed
场景: 前端调用方法的时候,调不通,并且报错信息为405 因为我们公司前后端分离开发,于是前端就来找我说我写的接口有问题?于是我就在这里的postman中测试发现没问题啊. 然后我好好看了一下报错信息 ...
- TODO Auto-generated method stub
在 菜单栏中 Window --> Preferences -->Java -->Code Style -->Code Templates--> Code --> ...
- [Android]通过js方法回调部分native报错 Web Console: Uncaught TypeError: Object [object Object] has no method 'xxx'
在android4.2以前,注入步骤如下: webview.getSetting().setJavaScriptEnable(true); class JsObject { public String ...
- Struts2 - Interceptor中取得ActionName、Namespace、Method
在Struts2的Interceptor中取得当前执行对应的ActionName.Namespace.Method方法: 可以使用: System.out.println(invocation.get ...
- 去掉代码中自动生成的TODO Auto-generated method stub
Window --> Preferences -->Java -->Code Style -->Code Templates--> Code --> Method ...
- Thread’s start method and run method
工作中用到了Thread,一开始用错了,仔细研究了一下,稍作整理. 前言,今天写代码居然这样写的 new Thread() { @Override public void run() { System ...
- BookNote: Refactoring - Improving the Design of Existing Code
BookNote: Refactoring - Improving the Design of Existing Code From "Refactoring - Improving the ...
随机推荐
- Python 利用微信端口查看列车时刻表
import requests """ 该程序查看列车时刻 """ url0 = 'http://www.webxml.com.cn/Web ...
- sql中desc的妙用
很多情况下对表内部结构不熟悉,想看下我创建的表里面又多少表明,又想他按照首字母的规律排列, 这时候就要用desc +表名了. desc t_bike_info; hive> desc t_bik ...
- 《DSP using MATLAB》Problem 9.4
只放第1小题. 代码: %% ------------------------------------------------------------------------ %% Output In ...
- 初学hibernate的心得体会
在初步学习了hibernate之后,使我明白了hibernate是一个怎样的软件.hibernate是一个比较独立的框架,它不需要太多其他软件的支持.hibernate是一个开放源代码的关系映射框架, ...
- 22-MySQL-Ubuntu-备份与恢复
案例: 将数据库jing_dong_1的数据库备份,然后恢复到数据库jing_dong_2; 步骤如下: 1.备份 注意: mysqldump 不是 mysql; 尖括号的方向; python.sql ...
- LeetCode 67. Add Binary【个位补0,不必对齐】【easy】
Given two binary strings, return their sum (also a binary string). The input strings are both non-em ...
- Nlog 日志框架简单教程
安装 Nuget获取 配置寻找 会自动寻找在应用程序目录下的NLog.config(大小写敏感) 如何配置config <?xml version="1.0" encodin ...
- odoo 分组视图下显示同一批次记录的总数
修改前: 修改后: xml文件: <?xml version="1.0" encoding="utf-8"?> <!-- vim:fdn=3: ...
- leetcode-229-求众数②
题目描述: 方法一:摩尔投票法 class Solution: def majorityElement(self, nums: List[int]) -> List[int]: candiate ...
- [JZOJ6278] 2019.8.5【NOIP提高组A】跳房子
题目 题目大意 给你一个矩阵,从\((1,1)\)开始,每次往右上.右.右下三个格子中权值最大的那个跳. 第一行上面是第\(n\)行,第\(m\)列右边是第\(1\)列.反之同理. 有两个操作:跳\( ...