| 10 | | $welcome->message = 'This is the default Kohana index page. You can edit <tt>application/controllers/welcome.php</tt> now.'; |
| | 13 | |
| | 14 | // You can assign anything variable to a view by using standard OOP |
| | 15 | // methods. In my welcome view, the $title variable will be assigned |
| | 16 | // the value I give it here. |
| | 17 | $welcome->title = 'Welcome to Kohana!'; |
| | 18 | |
| | 19 | // An array of links to display. Assiging variables to views is completely |
| | 20 | // asyncronous. Variables can be set in any order, and can be any type |
| | 21 | // of data, including objects. |
| | 22 | $welcome->links = array |
| | 23 | ( |
| | 24 | 'License' => url::base(FALSE).'Kohana License.html', |
| | 25 | 'Home Page' => 'http://kohanaphp.com/', |
| | 26 | 'Documentation' => 'http://doc.kohanaphp.com/', |
| | 27 | 'Forum' => 'http://forum.kohanaphp.com/', |
| | 28 | ); |
| | 29 | |
| | 30 | // Using views inside of views is completely transparent. In the welcome |
| | 31 | // view, printing the $content variable will render the welcome_content view. |
| | 32 | $welcome->content = new View('welcome_content'); |
| | 33 | |
| | 34 | // Using render(TRUE) forces the view to display now, instead of |
| | 35 | // returning an HTML string. |