2017-02-27 7 views
0

사용자 지정 리소스 (뉴스 레터)에서 그리드를 만들었으므로 각 줄에 "보내기"버튼을 defaut "편집"및 "삭제"옆에 추가하고 싶습니다. "단추. 그러나 그리드의 정의에서 사용자 지정 작업을 정의하고 내가 Sylius의 문서에서 정보를 찾을 수없는 방법을 모르겠어요 ... 여기 Sylius 리소스 그리드에서 사용자 지정 작업 추가

내 그리드 데프입니다 :

sylius_grid: 
    grids: 
     admin_newsletter: 
      driver: 
       name: doctrine/orm 
       options: 
        class: NewsletterBundle\Entity\Newsletter 
      sorting: 
       date: desc 
      fields: 
       titre: 
        type: string 
        label: sylius.ui.title 
        sortable: ~ 
       date: 
        type: datetime 
        label: sylius.ui.date 
        sortable: ~ 
        options: 
         format: d/m/Y 
       envoye: 
        type: twig 
        label: admin.ui.newsletter_envoye 
        sortable: ~ 
        options: 
         template: NewsletterBundle:Helper:_sent.html.twig 
      filters: 
       search: 
        type: string 
        label: sylius.ui.search 
        options: 
         fields: [titre] 
      actions: 
       main: 
        create: 
         type: create 
       item: 
        update: 
         type: update 
        delete: 
         type: delete 

        # This is what I want: 
        send: 
         type: send 

모든 그걸 어떻게 할 생각인가?

감사합니다.

답변

3

내가 생각하는 자신의 작업 템플릿을 추가하기 만하면 모든 (AppBundle/자료/의견/그리드/액션/send.html.twig),

다음 응용 프로그램/설정에서 설정하세요

/config.yml :

기본 동작 여기에 정의 된 것처럼 : https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/AdminBundle/Resources/config/app/config.yml#L34

sylius_grid: 
    templates: 
     action: 
      send: "@AppBundle/Grid/Action/send.html.twig" 

확인 템플릿 경로를, 나는 그것의 확실하지 않다 때문이다.

+0

그게 전부 야! Tks CoderMaggie :) – wyllyjon