2016-10-27 56 views
0

您好我使用sonatadminbundle管理我的實體我工作得很好。但我想添加刪除更新我的實體時,默認情況下自定義消息它看起來像這樣AppBundle \ Entity \ Product:000000000727a2de000000005cccd6bd 項目「AppBundle \ Entity \ Product:000000004284b7de00000000791d9693」已成功更新。 我想補充我自己的消息 THISIS我的儀表盤 enter image description here當使用sonatadminbundle添加更新刪除實體時自定義消息

回答

0

成功的消息是一個標準的symfony Flash message。 消息設置在Sonata\AdminBundle\Controller\CRUDController與關鍵字:sonata_flash_success/sonata_flash_error/sonata_flash_info並與通用翻譯相關聯。

您可以覆蓋翻譯,或者如果您希望可以覆蓋管理控制器中的相應操作並執行所需操作。 你也可以從你的實體開始添加一個_toString()函數,它比「AppBundle \ Entity \ Product:000000000727a2de000000005cccd6bd」

+0

好得多非常感謝你 –

相關問題