-
-
Notifications
You must be signed in to change notification settings - Fork 6
Hello World tutorial
Outputting "Hello, World!" from WebEngine is as simple as writing the message in the page/index.html
file and serving it. Even though this task seems very simplistic, it serves a purpose in acting as a more in-depth guide in setting up the environment for running WebEngine apps, and acts as a basis for the future follow-on tutorials.
Before we jump into setting up the environment, here's a spoiler:
page/index.html
<!doctype html>
<h1>Hello, World!</h1>
Then run gt run
from the project root and visit http://localhost:8080 to see your glorious program in action.
Other installation methods are documented in Installation, but if you are able to use the automated installer, you can use Composer to create new WebEngine applications very quickly.
If you have not got PHP or Composer installed, you will need to do that first -- check the PHP environment setup section for a guide on how to do this.
Once you have Composer set up, and can type composer
from the terminal, run the command composer --global require phpgt/installer
. This installs the Installer repository for you globally, making the gt
command available in your terminal. After running the command and gt
is still not available, double check you have added the Composer's bin directory to your PATH environment variable, as described in [[Adding gt
to your PATH]]
// TODO: CLI installation process.
// TODO: gt create hello-world
// TODO: Explain how project can be created manually: mkdir hello-world && cd hello-world && composer require phpgt/webengine
// TODO: Write the "Hello, World!" message.
// TODO: File structure that makes up WebEngine projects is described in Project layout.
// TODO: Run gt run
and explain what it does.
// TODO: More details on setting up servers is documented in Running your application.
// TODO: http://localhost:8080
// TODO: Link on to next tutorial.
- Request-response lifecycle
- Running your application
- Project layout
- Application architecture
- Web servers
- URIs
- Page view
- Dynamic URIs and pages
- Headers and footers
- Page logic
- Protected globals
- User input
- Cookies
- Sessions
- DOM manipulation
- Custom HTML components
- DOM templates
- Binding data to the DOM
- Database
- Client side assets
- API Webservices
- Security
- Configuration
- Build system
- Coding styleguide