php bind data explanation (possibly kohana specific?)

AzN-Battle

New Member
Attempting to dive in to Kohana and I'm reading the Unofficial 3.0 Kohana wiki as it's more user friendly than the user docs atm imo.It mentions "Binding Data to a View", like so:\[code\]<?php defined('SYSPATH') or die('No direct script access.');class Controller_Welcome extends Controller { public function action_index() { $about_page = View::factory('pages/about') ->bind('title', $title) ->bind('header', $header); $title='This is my title'; $title='This is my header'; $this->request->response = $about_page; }} // End Welcome\[/code\]Which outputs:\[code\]<html><head> <title>This is my title</title> </head> <body> <h1>This is my header</h1> </body> </html>\[/code\]How is this possible? Or what's this method/process called?The variables are set after they are "used", if you like, hence my confusion.Thanks for any insight.
 
Back
Top