Hello World Example

Step 1: Folder Creation

Create a new sub folder named HelloWorld under the Sodium-Site\apps folder of the installation path.

Step 2: Control File

Controller File: Create a file named controller.sqlx. It will be empty. For more information about controller file.

Step 3: Form File

Form File: Create a file named HelloWorld.frmx and copy/paste the code block showed below into the file.

<!DOCTYPE html>
  
<html>
    <head>
        <title>Hello World</title>

    </head>
  
    <body>
        
        <br />
        <br />

        <controlblock control-block-name="cbDemo">
            <input name="say_hello_world" type="button" value="Say Hello World" style="display: block; margin-left: auto; margin-right: auto; width: 150px;"/>
            <br/>
            <input name="something" type="text" style="display: block; margin-left: auto; margin-right: auto; width: 150px;"/>
            <input name="say_something" type="button" value="Say Something" style="display: block; margin-left: auto; margin-right: auto; width: 150px;"/>
        </controlblock>
  
    </body>
</html>

Form File Explanation:

  • It is a plain html file. The only difference is a controlblock tag on the lines between 14 and 19 with a name control-block-name="cbDemo". For more information on control blocks, please follow the link Control Blockarrow-up-right.

  • There is nothing special about the input tag in the control block. For more information on buttons, please follow the link Button Itemarrow-up-right.

Step 4: Code Behind File

Code behind File: Create a file named HelloWorld.sqlx and copy/paste the code block showed below into the file.

Code behind Explanation:

Output

In order to open page, write the form file path into the address bar of the Internet browser (http://localhost:8089/Sodium-Site/apps/helloworld/helloworld.frmxarrow-up-right). After each file request, "Page loaded" will be shown. After click on "Say Hello World" button, "Hello World" message will be shown on four times with different style.

Video

Last updated