{"id":18766205,"url":"https://github.com/vovayatsyuk/sublime-magic-templates","last_synced_at":"2025-04-13T05:30:44.948Z","repository":{"id":49811502,"uuid":"143208838","full_name":"vovayatsyuk/sublime-magic-templates","owner":"vovayatsyuk","description":"Magically simple PHP templates","archived":false,"fork":false,"pushed_at":"2025-02-25T13:48:25.000Z","size":2640,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T22:11:43.759Z","etag":null,"topics":["magento2-generator","sublime-text-3"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vovayatsyuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-01T21:07:33.000Z","updated_at":"2024-11-28T08:19:31.000Z","dependencies_parsed_at":"2024-05-07T09:39:43.703Z","dependency_job_id":"a76af591-9800-4a42-b940-66d90b1889b3","html_url":"https://github.com/vovayatsyuk/sublime-magic-templates","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fsublime-magic-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fsublime-magic-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fsublime-magic-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vovayatsyuk%2Fsublime-magic-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vovayatsyuk","download_url":"https://codeload.github.com/vovayatsyuk/sublime-magic-templates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670283,"owners_count":21142895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["magento2-generator","sublime-text-3"],"created_at":"2024-11-07T18:39:20.945Z","updated_at":"2025-04-13T05:30:44.925Z","avatar_url":"https://github.com/vovayatsyuk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✨ MagicTemplates ✨\n\n[![Build Status](https://travis-ci.org/vovayatsyuk/sublime-magic-templates.svg?branch=master)](https://travis-ci.org/vovayatsyuk/sublime-magic-templates)\n\nTired to type the same boilerplate code for each new file? MagicTemplates plugin\nautomatically inserts autogenerated content for all ~~known~~ files. And it's\nnot just a static snippet, but a magically generated working code!\n\n```php\n# 1. You create a new `Menu.php` file in swissup/module-navigationpro/src/Model/ResourceModel/\n\n# 2. MagicTemplates is doing its job:\n\n　∧＿∧\n（｡･ω･｡)つ━☆・*。\n⊂　　 ノ 　　　・゜+.\nしーＪ　　　°。+ *´¨)\n　　.· ´¸.·*´¨) ¸.·*¨)\n(¸.·´ (¸.·’* ⛧\n\n\u003c?php\n\nnamespace Swissup\\Navigationpro\\Model\\ResourceModel;\n\nuse Magento\\Framework\\Model\\ResourceModel\\Db\\AbstractDb;\n\nclass Menu extends AbstractDb\n{\n    /**\n     * Model initialization\n     *\n     * @return void\n     */\n    protected function _construct()\n    {\n        $this-\u003e_init('swissup_navigationpro_menu', 'menu_id');\n    }\n}\n```\n\nSee? And that was a single example, while module supports [much](#templates)\n[much](#snippets-beta) more!\n\n## Installation\n\n 1. Run “Package Control: Install Package” command\n 2. Type `MagicTemplates` and press \u003ckbd\u003eEnter\u003c/kbd\u003e\n\n## Configuration\n\nOpen Sublime Preferences and add `mt-` trigger for xml files:\n\n```\n\"auto_complete_triggers\": [\n    [keep_original_triggers],\n    {\"selector\": \"text.xml\", \"characters\": \"mt-\"}\n],\n```\n\n## Examples\n\n### PHP Template\n\n![Template for Magento2 resource model](docs/assets/images/php-template.gif)\n\n### PHP Snippets\n\n![Template and snippets for Magento2 plugin](docs/assets/images/php-snippets.gif)\n\n### XML Template and Snippets\n\n![Template and snippets for Magento2 form ui_component](docs/assets/images/xml-template-and-snippets.gif)\n\n## How it works?\n\n### Templates\n\nWhen you create a file, plugin do the following things:\n\n 1. Searches for the closest `composer.json` file (This approach allows to work\n    with multiple projects in the same window)\n 2. Detects project type, autoload parameters, and other useful information\n    by its content\n 3. If the project type matches one of the known types, plugin searches for the\n    [template](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/magento2/files.json)\n    to use. If found - contents is automatically generated and inserted into\n    the file.\n\n    - Here is a pretty simple template for\n      [Magento's Collection](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/magento2/files/Model/ResourceModel/Entity/Collection.php.txt)\n    - Here is a little bigger template for\n      [Magento's Form](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/magento2/files/view/adminhtml/ui_component/form.xml.txt)\n\n### Snippets (beta)\n\nSublime's native snippets mechanism doesn't allow to filter out available\nsnippets depending on filename pattern. MagicTemplates plugin\n[allows to create](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/magento2/snippets.json)\nsuch kind of dynamic snippets!\n\nThis feature allows to reduce the number of shown snippets for various files.\nFor example, when working with Magento's `layout.xml` file MagicTemplates will\nnever show you autocompletions written for `ui_component.xml` files.\n\nAdditionally, these snippets fully supports MagicTemplates variables which\nallows to generate\n[more](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/magento2/snippets/view/base/layout/css.txt)\n[code](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/magento2/snippets/etc/di.xml/virtualType.txt)\nthat simply works.\n\n## Known Applications\n\n -  ~~Laravel~~\n -  ~~Magento1~~\n -  Magento2\n -  And a few [templates](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/php/files.json)\n    and [snippets](https://github.com/vovayatsyuk/sublime-magic-templates/blob/master/templates/php/snippets.json)\n    for unknown php applications\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvovayatsyuk%2Fsublime-magic-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvovayatsyuk%2Fsublime-magic-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvovayatsyuk%2Fsublime-magic-templates/lists"}