{"id":172,"date":"2019-06-25T15:24:38","date_gmt":"2019-06-25T15:24:38","guid":{"rendered":"https:\/\/privateblog.nobytesleft.net\/?p=172"},"modified":"2019-07-18T12:51:24","modified_gmt":"2019-07-18T12:51:24","slug":"symfony-notes-building-the-download-portal","status":"publish","type":"post","link":"https:\/\/privateblog.nobytesleft.net\/?p=172","title":{"rendered":"Symfony notes &#8211; building the Download Portal"},"content":{"rendered":"<p>Another useful tool we try to use is the MakerBundle. We start by making a Category editor.<\/p>\n<pre class=\"\">$ bin\/console make:crud Category\r\n<\/pre>\n<p>Then we have to adjust the URLs, add the fact that categories are always defined &#8220;by project&#8221;, and so on, by editing the Controller and the templates.<\/p>\n<h2>Update<\/h2>\n<p>Never use this. It forces you to:<\/p>\n<ul>\n<li>have logic dispersed into files which are not required<\/li>\n<li>have the same form for creating and editing, unless you disperse things even more with the &#8220;solution&#8221; outlined <a href=\"https:\/\/blog.martinhujer.cz\/symfony-forms-with-request-objects\/\">here<\/a><\/li>\n<\/ul>\n<p>Use instead the &#8220;viable solution&#8221; criticised by the above article, <a href=\"https:\/\/symfony.com\/doc\/current\/form\/without_class.html\">how to use forms with data stored in array<\/a>, so that you put the logic in the controller (where it should be, whatever the Symfony people say) and STOP.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another useful tool we try to use is the MakerBundle. We start by making a Category editor. $ bin\/console make:crud Category Then we have to adjust the URLs, add the&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":2,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"predecessor-version":[{"id":176,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions\/176"}],"wp:attachment":[{"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/privateblog.nobytesleft.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}