php - Symfony 无法加载 TextType 类
问题描述
我有 symfony 4.1 版,我先尝试安装 symfony/form 组件,截图如下:http: //prntscr.com/jqqvdl
接下来,我收到此错误 - http://prntscr.com/jqqxdg
错误:
无法加载类型“Symfony\Component\Form\Extension\Core\TextType”:类不存在。
任何人都知道如何修复这个 symfony 错误?
解决方案
事实上,正确的命名空间是:
Symfony\Component\Form\Extension\Core\Type\TextType
TextType在 下Symfony\Component\Form\Extension\Core\Type
,见:
use Symfony\Component\Form\Extension\Core\Type\TextType;
//...
$form = $this->createFormBuilder()
->add('task', TextType::class)
->getForm();
推荐阅读
- java - Graph API 在我有 URI 时需要照片 URL
- github-actions - 跳过上一个作业时 Github 操作作业触发
- protobuf-net - Protobuf-net 使用已编译的 TypeModel 时,模型没有可用的类型序列化器
- javascript - 如何保持项目更新?
- html - swiper (https://www.npmjs.com/package/swiper) 和 cdkDrag(https://material.angular.io/cdk/drag-drop/overview) 是否在 Angular 2+ 中一起工作?
- azure-data-factory-pipeline - 在 ADF 管道中使用托管 VNet 执行 MS SQL 存储过程
- php - 从php获取返回值到ajax
- pine-script - 无法正确交易 EMA 脚本
- apache-superset - windows linux子系统上的超集稳定性
- javascript - 按确切值匹配 PotsgreSQL timestamptz