{"id":275872,"date":"2016-03-10T17:11:02","date_gmt":"2016-03-10T14:11:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=275872"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=275872","title":{"rendered":"SonataAdminBundle: \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438\u0437 List View (\u0447\u0430\u0441\u0442\u044c 1)"},"content":{"rendered":"<br \/>\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>  \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u0438\u0441\u0435\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0432\u044f\u0437\u044c\u044e \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 (\u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0438\u0434 \u0441\u0432\u044f\u0437\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442) \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u0432\u0435\u0442\u0430\u043c\u0438 \u043d\u0430 \u043f\u0438\u0441\u044c\u043c\u0430. \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f SonataAdminBundle (\u0442.\u0435. \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d Admin-\u043a\u043b\u0430\u0441\u0441). \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 (List View) \u043f\u0438\u0441\u0435\u043c.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u0443\u0449\u043d\u043e\u0441\u0442\u0438 (entity) \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u043e\u0442\u0432\u0435\u0442\u0430 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    namespace AppBundle\\Entity;      use Doctrine\\ORM\\Mapping as ORM;      \/**     * @ORM\\Entity     * @ORM\\Table(name=&quot;incoming&quot;, options={&quot;comment&quot;:&quot;\u0412\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043f\u0438\u0441\u044c\u043c\u043e&quot;})     *\/     class Incoming     {         \/**         * @ORM\\Column(type=&quot;integer&quot;)         * @ORM\\Id         * @ORM\\GeneratedValue(strategy=&quot;AUTO&quot;)         *\/         protected $id;          protected $incomingTitle;          \/**         * @ORM\\OneToOne(targetEntity=&quot;Response&quot;, mappedBy=&quot;incoming&quot;)         *\/         protected $response;          \/\/ \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044f          \/**         * \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043f\u0438\u0441\u044c\u043c\u043e         *         * @param \\AppBundle\\Entity\\Response $response         *         * @return \\AppBundle\\Entity\\Incoming         *\/         public function setResponse( \\AppBundle\\Entity\\Response $response)         {             $this-&gt;response = $response;              return $this;         }     }      <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043f\u0438\u0441\u044c\u043c\u043e<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    namespace AppBundle\\Entity;      use Doctrine\\ORM\\Mapping as ORM;      \/**     * @ORM\\Entity     * @ORM\\Table(name=&quot;response&quot;, options={&quot;comment&quot;:&quot;\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u043f\u0438\u0441\u044c\u043c\u043e&quot;})     *\/     class Response     {         \/**         * @ORM\\Column(type=&quot;integer&quot;)         * @ORM\\Id         * @ORM\\GeneratedValue(strategy=&quot;AUTO&quot;)         *\/         protected $id;          \/**         * @ORM\\Column(type=&quot;text&quot;, options={&quot;comment&quot;:&quot;\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043e\u0442\u0432\u0435\u0442\u0430&quot;})         *\/         protected $responseTitle;          \/**         * @ORM\\OneToOne(targetEntity=&quot;Incoming&quot;, inversedBy=&quot;response&quot;)         * @ORM\\JoinColumn(name=&quot;incoming_id&quot;, referencedColumnName=&quot;id&quot;)         *\/         protected $incoming;          \/**          * @ORM\\Column(type=&quot;text&quot;, options={&quot;comment&quot;:&quot;\u0422\u0435\u043a\u0441\u0442 \u043e\u0442\u0432\u0435\u0442\u0430&quot;})          *\/         protected $text;          \/**         * \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u0438\u0441\u044c\u043c\u0430         *         * @param \\AppBundle\\Entity\\Incoming $incoming         *         * @return \\AppBundle\\Entity\\Response         *\/         public function setResponse( \\AppBundle\\Entity\\Incoming $incoming)         {             $this-&gt;incoming = $incoming;              return $this;         }          \/\/\u0414\u0440\u0443\u0433\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f     } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h2>\u0412\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e Custom Admin Action \u0432 SonataAdminBundle, \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u0432 <a href=\"#CCAA\">[1]<\/a>. \u0421\u043b\u0435\u0434\u0443\u044f \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0442\u0432\u0435\u0442\u0430, \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u043a \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 \u043f\u0438\u0441\u044c\u043c\u0430 \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u0434\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0435\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e:<\/p>\n<ul>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043e\u0442\u0432\u0435\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, createResponseAction) \u0432 CRUD \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435, \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u043e\u0442 Sonata\\AdminBundle\\Controller\\CRUDController<\/li>\n<li>\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 createAction \u0438\u0437 Sonata\\AdminBundle\\Controller\\CRUDController \u0432 \u043d\u0430\u0448\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0432\u043d\u0435\u0441\u044f \u0432 \u043d\u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u044b\u0448\u0435<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e Custom Admin Action, \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u0435\u0434\u0435\u0442 \u043a \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430 \u0438 \u0447\u0440\u0435\u0432\u0430\u0442 \u043d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438 \u043f\u0440\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0435 createAction \u0434\u043e createResponseAction. \u0418\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432 \u043f\u043e\u0434\u0445\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044f \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Sonata\\AdminBundle\\Controller\\CRUDController.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u044d\u0442\u0430\u043f\u043d\u043e:<\/p>\n<ul>\n<li>\u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u043c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043d\u043e\u043f\u043a\u0438) \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 List View \u043f\u0438\u0441\u0435\u043c;<\/li>\n<li>\u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u0438 \u043f\u0438\u0441\u044c\u043c\u043e\u043c, \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u044b\u043b \u043d\u0430\u0436\u0430\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, <b>\u0434\u043e<\/b> \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<h3>\u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430<\/h3>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 ListView \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d \u0432 <a href=\"#CCAA\">[1]<\/a>. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445, \u043a\u0430\u0441\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 url \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0439 \u0432 <a href=\"#CCAA\">[1]<\/a> \u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/p>\n<pre><code class=\"html\">{# src\/AppBundle\/Resources\/views\/CRUD\/list__action_create_other_admin.html.twig #} &lt;a class=&quot;btn btn-sm&quot; href=&quot;{{ admin.generateObjectUrl('create', object) }}&quot;&gt;\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442&lt;\/a&gt; <\/code><\/pre>\n<p>  \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044f admin.generateObjectUrl \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 url \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e Admin-\u043a\u043b\u0430\u0441\u0441\u0430; \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u043f\u0438\u0441\u044c\u043c\u043e (Incoming), \u0430 \u043d\u0443\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b \u043e\u0442\u0432\u0435\u0442 (Response). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0443\u043a\u0440\u0430\u0441\u0438\u0432 \u043a\u043d\u043e\u043f\u043a\u0443 \u0438\u043a\u043e\u043d\u043a\u043e\u0439:<\/p>\n<pre><code class=\"html\">{# src\/AppBundle\/Resources\/views\/CRUD\/list__action_create_other_admin.html.twig #} &lt;a href=&quot;{{ admin.getRouteGenerator.generateUrl(template_variables.otherAdmin, 'create'}&quot; class=&quot;btn btn-sm btn-default edit_link&quot; title=&quot;\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442&quot;&gt;     &lt;i class=&quot;fa fa-plus&quot;&gt;&lt;\/i&gt;     \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0432\u0435\u0442 &lt;\/a&gt; <\/code><\/pre>\n<p>  \u041a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u0437\u0434\u0435\u0441\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 admin.getRouteGenerator.generateUrl, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 Admin-\u0441\u0435\u0440\u0432\u0438\u0441, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c url. \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 Admin-\u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043e\u0431\u0440\u0430\u0442\u0438\u0432\u0448\u0438\u0441\u044c \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 Symfony2 \u043f\u0440\u044f\u043c\u043e \u0438\u0437 list__action_create_other_admin.html.twig, \u0447\u0442\u043e \u043b\u0438\u0448\u0438\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e template_variables.otherAdmin, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u043d\u0438\u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c.<\/p>\n<p>  \u0428\u0430\u0431\u043b\u043e\u043d\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0430\u043c _actions \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 ListView, \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c twig-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 include \u0448\u0430\u0431\u043b\u043e\u043d\u0430 SonataAdminBundle CRUD\\list__action.html.twig, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<pre><code class=\"html\">{% include actions.template %} <\/code><\/pre>\n<p>  \u0433\u0434\u0435 actions.template \u2014 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u044f\u0435\u0442\u0441\u044f \u0432 Admin-\u043a\u043b\u0430\u0441\u0441\u0435 \u0432 \u0441\u0435\u043a\u0446\u0438\u0438 configureListFields.<\/p>\n<pre><code class=\"php\">    protected function configureListFields(ListMapper $listMapper)     {         $listMapper          \/\/ other fields...              -&gt;add('_action', 'actions', array(                 'actions' =&gt; array(                  \/\/ ...                  'createOtherAdmin' =&gt; array(                      \/\/ \u0412\u041e\u0422 \u042d\u0422\u0410 \u041f\u0415\u0420\u0415\u041c\u0415\u041d\u041d\u0410\u042f                     'template' =&gt; 'AppBundle:CRUD:list__action_create_other_admin.html.twig'                 )             )         ))         ;     } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 CRUD\\list__action.html.twig \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e with, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u044b. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0435 \u0432\u0441\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0435\u0435 \u043d\u0430\u043b\u0438\u0447\u0438\u0435:<\/p>\n<pre><code class=\"html\">    {% include actions.template with {template_variables : (actions.template_variables is defined ? actions.template_variables : null)} %} <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e template_variables.otherAdmin \u0432 Admin-\u043a\u043b\u0430\u0441\u0441\u0435, \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0432 \u0435\u0439 \u043d\u0443\u0436\u043d\u044b\u0439 Admin-\u0441\u0435\u0440\u0432\u0438\u0441 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e sonata.admin.response) \u0438 \u043e\u043d\u0430 \u0441\u0442\u0430\u043d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 list__action_create_other_admin.html.twig.<\/p>\n<pre><code class=\"php\">    protected function configureListFields(ListMapper $listMapper)     {         $listMapper          \/\/ other fields...              -&gt;add('_action', 'actions', array(                 'actions' =&gt; array(                  \/\/ ...                  'createOtherAdmin' =&gt; array(                      'template' =&gt; 'AppBundle:CRUD:list__action_create_other_admin.html.twig',                      \/\/ \u041f\u0435\u0440\u0435\u0434\u0430\u0435\u043c Admin-\u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d                     'template_variables' =&gt; array('otherAdmin'=&gt; $this-&gt;getConfigurationPool()-&gt;getContainer()-&gt;get('sonata.admin.response');)                 )             )         ))         ;     } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 List View \u043f\u0438\u0441\u0435\u043c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0430 \u043f\u0438\u0441\u044c\u043c\u043e.<\/p>\n<p>  \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0438\u0441\u044c\u043c\u043e\u043c \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u043c \u043d\u0430 \u043d\u0435\u0433\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u0440\u0430\u0432 \u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>  <a name=\"CCAA\"><\/a>  <\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/sonata-project.org\/bundles\/admin\/master\/doc\/cookbook\/recipe_custom_action.html\">CREATING A CUSTOM ADMIN ACTION<\/a><\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/278987\/\"> https:\/\/habrahabr.ru\/post\/278987\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h2>\u041f\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0437\u0430\u0434\u0430\u0447\u0438<\/h2>\n<p>  \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u0438\u0441\u0435\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u0432\u044f\u0437\u044c\u044e \u043e\u0434\u0438\u043d-\u043a-\u043e\u0434\u043d\u043e\u043c\u0443 (\u0434\u043b\u044f \u0446\u0435\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0438\u0434 \u0441\u0432\u044f\u0437\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442) \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0442\u0432\u0435\u0442\u0430\u043c\u0438 \u043d\u0430 \u043f\u0438\u0441\u044c\u043c\u0430. \u0414\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f SonataAdminBundle (\u0442.\u0435. \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d Admin-\u043a\u043b\u0430\u0441\u0441). \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 (List View) \u043f\u0438\u0441\u0435\u043c.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-275872","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=275872"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/275872\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=275872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=275872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=275872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}