【发布时间】:2021-03-15 10:22:57
【问题描述】:
我想为一般用例提供另一种描述。
表单字段(或表单类型)可以按如下方式生成。
<?php
namespace App\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class registration_form extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->add('address_street');
}
}
?>
标签“地址街道”相应地显示在到目前为止的测试网页上。 我想实现按需显示翻译后的信息。
因此我想我需要为执行环境传递专用参数,以便从选定的信息源检索翻译数据并应用而不是指定输入字段名称。
您想根据已知的关键词为这样的应用程序添加任何进一步的想法吗?
- 国家语言支持
- 国际化
- 本地化
- 翻译
另请参阅: Symfony forms for Translatable Doctrine entities
机会将如何演变为improve the software documentation for the involved function arguments,以便数据模型(和相应的表单字段)可以以更简单、更安全的方式进行转换?
【问题讨论】:
标签: forms symfony localization internationalization field