我為我的物體創建了 CRUD,我需要以某種方式定義物體欄位的標簽。
我可以在表單型別中定義它們,例如:
$builder
->add('name' , null, [
'attr' => ['autofocus' => true],
'label' => 'Product name',
])
但我認為這不是最好的解決方案。
哪個是最好的方法?
即使應用程式是單一語言,我是否必須使用翻譯?
還有其他解決方案嗎?
uj5u.com熱心網友回復:
是的,這是最好的做法,在此處解釋的官方檔案中 https://symfony.com/doc/current/reference/forms/types/form.html#label-translation-parameters
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/475565.html
標籤:交响乐
