M
M
microf2020-05-09 06:53:57
PHP
microf, 2020-05-09 06:53:57

How to make a code generator?

Good afternoon. How do code generators work? Let's say I want to create an index.php with I store templates somewhere `classTemplate.php` open a file with `file_get_contents` and insert variables `className` and so on? Or just doing somethingclass Name extends Event

ClassBuilder->setClassName('Name')->setExtends('Event')
? And how do I paste the formatted code into the file I want to create?
This is a general question, I just don't understand how it works.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question