I’ve been trying to use a dynamic view in Kohana 3.2 without success. I’m using the following layout view with three views within that (meta, content, and footer).
view/layout:
<html>
<head>
<?php echo $meta ?>
</head>
<body>
<?php echo $content ?>
<?php echo $footer ?>
</body>
<html>
I am able to initially render all three views with no problem (the $meta view has a default set of values within it), but later on in the flow I assign and pass variables to a new $meta view, but the view does not update in my browser. I enabled logging for that particular view (after the variables have been passed) and it appears that everything is fine.
// Passing variables to view and rendering view in controller/layout
$this->template->meta = View::factory('meta');
$this->template->meta->url = $this->template->art->url;
$this->template->meta->name = $this->template->art->name;
$this->template->meta->image = $this->template->art->image;
$this->template->meta->about = $this->template->art->about;
$this->response->body($this->template->meta);
Kohana::$log->add(Log::INFO, 'TEMPLATE VALUE: ' . $this->template);
How can I either force update a particular view within a view, or how can I replace a view?
It turned out that the controller was being overridden by another controller. The original $this->response->body($this->template->meta) worked after disabling some of things down the line.
Thank you all for your help, it was greatly appreciated in working towards fixing it.