-
Notifications
You must be signed in to change notification settings - Fork 6
Build Your First Web Application
KentonJack edited this page Mar 4, 2018
·
5 revisions
The most basic component for a web application is the router.
A router accepts web requests and runs script accordingly. Now, let's create your first page using build::get() routing module. Create a PHP file named hello_world.php, under folder/build.
build::get("angel/[input]", function($input){
echo "angel".$input."!";
});As shown above, build::get() method contains two parameters:
- a router: yoursite.com/hello/[a_variable_name_input], variables in url are defined by [brackets].
- a function: a block of code (codeblock) that will execute when user visits the router's path using GET request.
So now, if you visit yoursite.com/angel/fly, here is the output:
angel fly!
Nice! You just created your first web application.