فهرست منبع

Merge pull request #2544 from greg0ire/documentation

simplify sample code
Thomas 10 سال پیش
والد
کامیت
a4c4a000e9
1فایلهای تغییر یافته به همراه1 افزوده شده و 3 حذف شده
  1. 1 3
      Resources/doc/cookbook/recipe_custom_action.rst

+ 1 - 3
Resources/doc/cookbook/recipe_custom_action.rst

@@ -100,9 +100,7 @@ to implement a ``clone`` action.
     {
         public function cloneAction()
         {
-            $id = $this->get('request')->get($this->admin->getIdParameter());
-
-            $object = $this->admin->getObject($id);
+            $object = $this->admin->getSubject();
 
             if (!$object) {
                 throw new NotFoundHttpException(sprintf('unable to find the object with id : %s', $id));