8. Templates

You can customize the global layout by tweaking the SonataAdminBundle configuration.

SonataAdminBundle の設定を変更することで全体レイアウトをカスタマイズすることができます。
sonata_admin:
    templates:
        # default global templates
        layout:  SonataAdminBundle::standard_layout.html.twig
        ajax:    SonataAdminBundle::ajax_layout.html.twig

        # default value if done set, actions templates, should extend global templates
        list:    SonataAdminBundle:CRUD:list.html.twig
        show:    SonataAdminBundle:CRUD:show.html.twig
        edit:    SonataAdminBundle:CRUD:edit.html.twig

You can also configure the templates used by the Form Framework while rendering the widget

また、ウィジェットを描画してう時にフォームフレームワークが使う連プレートを設定することもできます。

sonata_doctrine_orm_admin:
    templates:
        form: [ SonataDoctrineORMAdminBundle:Form:form_admin_fields.html.twig ]
        filter: [ SonataDoctrineORMAdminBundle:Form:filter_admin_fields.html.twig ]

You can also customize field types by adding types in the config.yml file. The default values are :

また config.yml ファイルにタイプを追加することでフィールドタイプをカスタマイズすることもできます。デフォルト値は以下の通りです。

sonata_doctrine_orm_admin:
    templates:
        types:
            list:
                array:      SonataAdminBundle:CRUD:list_array.html.twig
                boolean:    SonataAdminBundle:CRUD:list_boolean.html.twig
                date:       SonataAdminBundle:CRUD:list_date.html.twig
                time:       SonataAdminBundle:CRUD:list_time.html.twig
                datetime:   SonataAdminBundle:CRUD:list_datetime.html.twig
                text:       SonataAdminBundle:CRUD:base_list_field.html.twig
                trans:      SonataAdminBundle:CRUD:list_trans.html.twig
                string:     SonataAdminBundle:CRUD:base_list_field.html.twig
                smallint:   SonataAdminBundle:CRUD:base_list_field.html.twig
                bigint:     SonataAdminBundle:CRUD:base_list_field.html.twig
                integer:    SonataAdminBundle:CRUD:base_list_field.html.twig
                decimal:    SonataAdminBundle:CRUD:base_list_field.html.twig
                identifier: SonataAdminBundle:CRUD:base_list_field.html.twig

            show:
                array:      SonataAdminBundle:CRUD:show_array.html.twig
                boolean:    SonataAdminBundle:CRUD:show_boolean.html.twig
                date:       SonataAdminBundle:CRUD:show_date.html.twig
                time:       SonataAdminBundle:CRUD:show_time.html.twig
                datetime:   SonataAdminBundle:CRUD:show_datetime.html.twig
                text:       SonataAdminBundle:CRUD:base_show_field.html.twig
                trans:      SonataAdminBundle:CRUD:show_trans.html.twig
                string:     SonataAdminBundle:CRUD:base_show_field.html.twig
                smallint:   SonataAdminBundle:CRUD:base_show_field.html.twig
                bigint:     SonataAdminBundle:CRUD:base_show_field.html.twig
                integer:    SonataAdminBundle:CRUD:base_show_field.html.twig
                decimal:    SonataAdminBundle:CRUD:base_show_field.html.twig

Note

By default, if the SonataIntlBundle classes are available, then the numeric and date fields will be localized with the current user locale.

デフォルトでは、 SonataIntlBundle クラスが利用可能であれば、数字と日付のフィールドはユーザーロケールにローカライズされます。

Previous topic

7. Form types and data transformers

Next topic

9. Audit

This Page