-
-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a new WebEngine application
gt create starts a complete WebEngine application from a blueprint. It is the fastest way to go from an empty directory to a runnable project.
gt create [projectName] [--namespace|-n NAMESPACE] [--blueprint|-b BLUEPRINT]Example:
gt create blog --namespace Blog --blueprint hello-worldIf projectName, --namespace, or --blueprint are omitted, the command can ask for them interactively.
Internally, the command:
- validates the project directory name
- validates the PHP namespace
- chooses a blueprint
- runs
composer create-projectfor that blueprint - runs
composer updateinside the new project directory - offers to run the new application immediately
That means the command is more than a file copier: it is a guided project bootstrap process.
At the time of writing, the built-in blueprint list is:
emptyhello-worldhello-youtodo-list- More coming soon...
These are shown interactively with titles and descriptions if you do not pass --blueprint.
The project name becomes the directory name created in the current working directory.
Valid names may contain:
- letters
- numbers
- underscores
- hyphens
If a file or directory with that name already exists, the command stops before doing any work.
The namespace is the root PHP namespace for the generated application.
Example:
gt create blog --namespace BlogThat keeps the project's classes under Blog\... rather than a generic default.
If you omit the namespace interactively, the command suggests App.
After the blueprint has been installed successfully, gt create asks whether you would like to run the new application immediately.
If you answer yes, it changes into the new project directory and runs the same local development flow as gt run.
If you answer no, it leaves the new application on disk and prints the WebEngine getting-started link.
Blueprints are most useful when:
- you are learning WebEngine and want a working example to start from
- your team has settled on a common starting point for new applications
- you want a more guided introduction than a completely empty project gives
The empty blueprint is a good option when you want the framework structure without any extra demonstration code.
To see what happens after the project is created, move on to Running a project locally.
PHP.GT/GtCommand is the command-line entry point used by PHP.GT/WebEngine.