hello_world
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| hello_world [2020/11/14 15:06] – created sahl | hello_world [2023/11/18 08:46] (current) – sahl | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Here is an example of Hello World in Platform4PHP. | Here is an example of Hello World in Platform4PHP. | ||
| - | <code php> | + | < |
| + | <?php | ||
| echo "Hello World"; | echo "Hello World"; | ||
| </ | </ | ||
| Line 14: | Line 15: | ||
| Therefore if you need to say Hello World, just ask PHP to say Hello World. I won't get in your way with a complex framework. | Therefore if you need to say Hello World, just ask PHP to say Hello World. I won't get in your way with a complex framework. | ||
| + | |||
| + | Buuut if you want to utilize the framework, you could also do this: | ||
| + | |||
| + | <code php> | ||
| + | <?php | ||
| + | class HelloWorldComponent extends Component { | ||
| + | function renderContent() { | ||
| + | echo "Hello World"; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | $hello_world_component = new HelloWorldComponent(); | ||
| + | Page:: | ||
| + | $hello_world_component-> | ||
| + | Page:: | ||
| + | </ | ||
| + | |||
| + | A little more complex, but still easy to comprehend. | ||
hello_world.1605366369.txt.gz · Last modified: 2020/11/14 15:06 by sahl