Skip to content

Hello World tutorial

Greg Bowler edited this page Aug 21, 2018 · 34 revisions

Outputting "Hello, World!" from WebEngine is as simple as writing the message in an 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.

Installing WebEngine

// TODO: Other installation methods are documented in Installation.

// TODO: CLI installation process.

Starting a new project

// TODO: gt create hello-world

// TODO: Explain how project can be created manually: mkdir hello-world && cd hello-world && composer require phpgt/webengine

Editing index.html

// TODO: Write the "Hello, World!" message.

// TODO: File structure that makes up WebEngine projects is described in Project layout.

Serving the application

// TODO: Run gt run and explain what it does.

// TODO: More details on setting up servers is documented in Running your application.

Accessing the application in a web browser

// TODO: http://localhost:8080

Next step: Adding dynamic content

// TODO: Link on to next tutorial.

Clone this wiki locally