Bläddra i källkod

Do not specify 'actions' type on list _action field (#3827)

This is not necessary to specify it to get it working.
Sullivan SENECHAL 9 år sedan
förälder
incheckning
6f9039cd9c

+ 2 - 2
Resources/doc/cookbook/recipe_custom_action.rst

@@ -186,7 +186,7 @@ Next we have to add the action in ``configureListFields`` specifying the templat
 
 
              // other fields...
              // other fields...
 
 
-            ->add('_action', 'actions', array(
+            ->add('_action', null, array(
                 'actions' => array(
                 'actions' => array(
 
 
                     // ...
                     // ...
@@ -240,7 +240,7 @@ The full ``CarAdmin.php`` example looks like this:
                 ->add('engine')
                 ->add('engine')
                 ->add('rescueEngine')
                 ->add('rescueEngine')
                 ->add('createdAt')
                 ->add('createdAt')
-                ->add('_action', 'actions', array(
+                ->add('_action', null, array(
                     'actions' => array(
                     'actions' => array(
                         'show' => array(),
                         'show' => array(),
                         'edit' => array(),
                         'edit' => array(),

+ 2 - 2
Resources/doc/cookbook/recipe_sortable_listing.rst

@@ -75,7 +75,7 @@ and use the default twig template provided in the ``pixSortableBehaviorBundle``
 .. code-block:: php
 .. code-block:: php
 
 
 	$listMapper
 	$listMapper
-	    ->add('_action', 'actions', array(
+	    ->add('_action', null, array(
             'actions' => array(
             'actions' => array(
                 'move' => array(
                 'move' => array(
                     'template' => 'PixSortableBehaviorBundle:Default:_sort.html.twig'
                     'template' => 'PixSortableBehaviorBundle:Default:_sort.html.twig'
@@ -165,7 +165,7 @@ also define the sort by field to be position:
             $listMapper
             $listMapper
                 ->addIdentifier('name')
                 ->addIdentifier('name')
                 ->add('enabled')
                 ->add('enabled')
-                ->add('_action', 'actions', array(
+                ->add('_action', null, array(
                     'actions' => array(
                     'actions' => array(
                         'move' => array(
                         'move' => array(
                             'template' => 'AppBundle:Admin:_sort.html.twig'
                             'template' => 'AppBundle:Admin:_sort.html.twig'

+ 1 - 1
Resources/doc/reference/action_list.rst

@@ -82,7 +82,7 @@ Here is an example:
             ->add('image.name')
             ->add('image.name')
 
 
             // You may also specify the actions you want to be displayed in the list
             // You may also specify the actions you want to be displayed in the list
-            ->add('_action', 'actions', array(
+            ->add('_action', null, array(
                 'actions' => array(
                 'actions' => array(
                     'show' => array(),
                     'show' => array(),
                     'edit' => array(),
                     'edit' => array(),

+ 1 - 1
Resources/skeleton/Admin.php.twig

@@ -33,7 +33,7 @@ class {{ classBasename }} extends AbstractAdmin
     {
     {
         $listMapper
         $listMapper
             {{- code }}
             {{- code }}
-            ->add('_action', 'actions', array(
+            ->add('_action', null, array(
                 'actions' => array(
                 'actions' => array(
                     'show' => array(),
                     'show' => array(),
                     'edit' => array(),
                     'edit' => array(),

+ 1 - 1
Tests/Fixtures/Admin/ModelAdmin.php

@@ -31,7 +31,7 @@ class ModelAdmin extends AbstractAdmin
             ->add('foo')
             ->add('foo')
             ->add('bar')
             ->add('bar')
             ->add('baz')
             ->add('baz')
-            ->add('_action', 'actions', array(
+            ->add('_action', null, array(
                 'actions' => array(
                 'actions' => array(
                     'show' => array(),
                     'show' => array(),
                     'edit' => array(),
                     'edit' => array(),