-
Notifications
You must be signed in to change notification settings - Fork 0
Create a view
Emaro edited this page Mar 23, 2017
·
1 revision
Here, you'll learn to use the most basic part of this mvc framework: creating a new view.
Go to the views folder and create a file which ends with '.view.php'.
Example: home.view.php
Home is the name of your view.
Throw all html stuff in the view which is usually found in the body tag of your html file.
You need not to add:
- A head
- A navigation
- A footer
To add a link to an site within the framework, use the php short tag: <?= ?>
. Special about the short tag is, that the echo/print can be left out.
<?php echo $var; ?>
<?= $var ?> // the same
The method viewLink(<id>, <label>)
inserts a link to a view. If we use our example again, we will get the following code:
<!-- Some html with a link -->
<?=viewLink('home', 'Take me Home')?>
Of course you can also use normal links.