{ "id": "114237", "key": "ALOY-662", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-05-10T22:50:59.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "Alloy", "notable" ], "versions": [], "issuelinks": [], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2015-11-27T02:56:16.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "13604", "name": "Tooling", "description": "Items related to Alloy tooling and workflow" } ], "description": "h2. Problem\r\n\r\nIt would be awesome to be able to override the default template Alloy generates for a controller/style/view. Currently, whenever you generate a controller, it creates and empty controller, a style.tss with a .container class, and a view.\r\n\r\nYou can edit these files in the alloy directory, but you are stuck with just one template.\r\n\r\nIt would be nice to specify a custom template depending on the controller you are generating.\r\n\r\nExamples of things that you could include in custom templates would make Ti/Alloy development much faster:\r\n- a row-like view with horizontally positioned elements with decent looking classes already applied to them with argument assignment already included.\r\n- code to load app libs/modules common in your app\r\n- certain classes you like to use/modify often based on the type of view you're creating\r\n- certain controller conventions/methods/exports etc that you use commonly in a lot of controllers to aid in window management/control flow/memory management/controller\r\n\r\nSuggestion would be to have a place in the project to store templates and add to \"alloy generate controller someController\" another argument to specify \"--template someTemplate\"\r\n\r\nIn addition, one could conceivably use alloy generate to add custom fields to a template.\r\n\r\ni.e. alloy generate controller bookRow --template row --elements ImageView:bookImage:arg Label:bookTitle:arg Button:buyButton\r\n\r\nThis would take a preconfigured row xml/tss/js (or you could use the default template) and add an ImageView with id bookImage, a Label with id bookTitle, and a Button with id buyButton. Some sort of flag is passed on bookImage and bookTitle to have stub controller code written to assign the values for this from the args passed to the controller.\r\n\r\nh2. Discussions\r\n\r\nhttp://developer.appcelerator.com/question/152233/overriding-alloy-generate", "attachment": [], "flagged": false, "summary": "Feature Request - \"alloy generate controller\" custom templates and arguments", "creator": { "name": "wpccolorblind", "key": "wpccolorblind", "displayName": "josh rose", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }