Closed lfolco closed 3 years ago
@lfolco You are welcome to open PR to either improve templates to make them more useful or add an option to disable this feature.
@lfolco added option to disable auto templates. You can set glob pattern in the settings, and templates would be used only for files matching that pattern. Set it to empty string to disable templates.
Would this mean that it would be an empty file then?
Right, empty file.
Hmm... what I am suggesting is to make the contents of the template more useful. A lot of code is generated in the db_schema.xml
template, for example, but what you really only need is the schema
definition:
<schema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd">
</schema>
Same goes for the the .phtml
template:
<div class="template">
<h1><?=$block->getName()?></h1>
</div>
Not sure anyone would actually use that snippet in their .phtml
template.
I was going to open a PR to remove the extraneous content that is added in the templates, but retain the useful parts.
This is a great extension! Is it possible to disable the auto-generated content when you create new files thgouh? For example, creating a PHTML template file you get this:
This is code that I always delete, every single time. Not sure how useful it is? Same goes for a lot of the XML templates.
I am more than happy to open a PR for this, but would rather not do it if you object to merging it.
Thanks!