This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:uphp_language_basics [2019/07/22 06:30] admin |
uphp:uphp_language_basics [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======uPHP | + | ======uPHP |
- | Blockly is a visual programming editor developed by Google. | + | The following sections describe how to work with uPHP scripts. |
- | Visual | + | =====uPHP Tags===== |
- | {{:uphp: | + | When [[hardware:wattmons|Wattmon]] parses a file, it looks for opening and closing tags, which are ''< |
- | To access the editor, go to File Manager and click the New Script button in the folder you wish to create the script. | + | <code php> |
+ | Some text | ||
+ | <? | ||
+ | print(‘hello, uPHP’); | ||
+ | ?> | ||
+ | Some more text | ||
+ | </ | ||
- | The visual editor is visible in the Designer tab. You can use the left navigation to drag code blocks | + | In addition, you can integrate multiple |
- | To change the file name or save as a different name, edit the File box at the top of the page and hit Save. To generate | + | <code php> |
+ | <? | ||
+ | If ($mycondition > 5) { | ||
+ | ?> This will only be output if my condition > 5 <? | ||
+ | } else { | ||
+ | ?> This will be output if the first condition is not true. <? | ||
+ | } | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | =====Instruction Separation===== | ||
- | If the script is to be inserted into the WattmonOS system, select the appropriate Hook in the drop down. This could be any of the following: | + | As in C and PHP, uPHP requires instructions |
- | ^ Hook ^ Description | + | |
- | | Run once at boot | This script will be run one time upon system reboot | + | |
- | | Run once per second | The script will be run once a second | | + | |
- | | Run once per minute | The script will be run once a minute | | + | |
- | | In Ajax Generation | The script will be run while generating | + | |
- | | In Home Page | The script | + | |
+ | |||
+ | =====Comments===== | ||
+ | |||
+ | uPHP supports ' | ||
+ | |||
+ | <code php> | ||
+ | <? | ||
+ | // comment 1 | ||
+ | $x=1; | ||
+ | # comment2 | ||
+ | $x=2; | ||
+ | print($x); | ||
+ | /* comment 3 */ | ||
+ | $x=3; | ||
+ | print($x); | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | The " | ||
+ | |||
+ | ' | ||
+ | |||
+ | <code php> | ||
+ | <? | ||
+ | /* | ||
+ | echo 'This is a test'; /* This comment will cause a problem */ | ||
+ | echo 'Print this also'; | ||
+ | */ | ||
+ | ?> | ||
+ | </ | ||
=====Programmer Reference===== | =====Programmer Reference===== |