====== Views ====== **What Are They?** Views usually contain the majority of the HTML your pages display. By putting your HTML in views you keep it separate from the PHP and makes your HTML code a lot easier to read and manage. **Basic Usage** Using views is really easy, as is everything else in Salem. To load a view you use the built in view function. Using the above function would load a view located at application/views/hello.php. **Passing Data To Views** You can pass some data to your views like so: 'Amazing!', 'content'=>"That's cool !" ) ); } } ?> Now in your view the data is available in this way <? echo $title; ?> **Views inside other ones** When you for some reason want to extend one view adding other view inside this, you can override the content for the new view or prepend the new view to the actual content: Base VIEW

Boring default content

This will be deleted only if we call a view that fill the content of this section

Something that stay here.

-May be some text will appear under this text-

And now the view that is going to extend this base view:

Hello, World!

WOOOoooOOOooOooo

Finally, when you want to call this extended view you must do: ---- [[documentation|Go back to Documentation]]