I’m new to Yii. I’m eager to learn and understand several things about it. First off, I’m trying to understand what the point is, of using the CLI to generate a webapp.
Following along in various tutorials, after downloading Yii, the first thing you do is generate the default webapp with the CLI tools. If generating the webapp always generates the exact same code every time you use it, then what is the point of generating it? Why isn’t the webapp code just included in the source that you download and “install” on your webserver? Generating something implies that you are using a creating something that is going to be different depending on a bunch of input variables. But the generator makes the same thing. Every time. What is the point of that?
The only thing I can think of is that it’s possible to customize the webapp template so that you can maybe generate different types of webapps? I could see that being helpful. Is this possible? If not, back to the original question. What is the point?
Take a look at ‘WebAppCommand.php’ in yii/framework/cli/commands/ and it should be revealed to you what it does.
What I usually do is create another ‘CostomAppCommand.php’ in that folder and add a new directory in yii/framework/cli/views/ which contains a set of files which usually makes up the web apps that I want generated.
And then I just do a yiic customapp blahblah instead.