Let's start with a simple example. First we need to create our view handling class:
Go ahead and create a 'views' directory in the same folder as SimpleView.php. In the views folder create:
That's it. Point your web browser at SimpleView.php and you should see your Hello World page.
Just a quote note about that $CACHE flag. By default Nest doesn't cache output pages. In production you'll want to set the $CACHE flag to true to have it compile once and then reuse that file.
At this point we've just displayed an HTML document, which we could have done easily without the need for a specialized library. So let's add a line to our SimpleView.php file:
Now let's change the nest template:That's it. Values can be displayed in the view by simply adding them as attributes and then inserting them as a token into the nest template. If you view SimpleView.php in a web browser you should see "Hello Tim!".