I'm using kohana 3.3 together with kostache. Ok how do you pass a variable from controller to class views and use it on a mustache file?..
Here's my code.
Controller:
public function action_update()
{
$layout = Kostache_Layout::factory();
$content = new View_Pages_Album_Update();
$album = ORM::factory('Album_Information', $this->request->post('id'));
$content->albumName = $album->Album_Name;
$content->albumArtist = $album->Artist;
$this->response->body($layout->render($content));
}
Views
class View_Pages_Album_Update {
public $title = 'Update Music';
public function album_edit()
{
return array(
array('albumName' => $this->albumName),
array('albumArtist' => $this->albumArtist),
);
}
}
Template
<label>Album Name:</label>
<input type="text" name="inputAlbumName" value="{{albumName}}" /><br />
<label>Artist:</label>
<input type="text" name="inputArtist" value="{{albumArtist}}" /><br />
When I run my code nothing is passed to the template file. So how do you pass it from controller => views => template?