Skip to content
Browse files

copying View properties over to the custom chamlparser so they are ac…

…cesible within HAML files ($this->here, etc..)
  • Loading branch information...
1 parent d83f7d1 commit 14802f0c2757e7906b8b168ce43661186d9ec648 @m3nt0r m3nt0r committed
Showing with 9 additions and 1 deletion.
  1. +9 −1 views/chaml.php
View
10 views/chaml.php
@@ -98,6 +98,10 @@ function __construct(&$controller) {
$this->ext = '.haml';
$this->Haml = new CakeHamlParser($this);
+ foreach ($this as $prop => $value) {
+ $this->Haml->{$prop} = $value;
+ }
+
$this->Haml->assign_by_ref('__haml', $this->Haml);
}
@@ -154,7 +158,11 @@ function render($action = null, $layout = null, $file = null) {
if ($content_for_layout !== false)
{
unset($this->Haml);
- $this->Haml = new CakeHamlParser($this);
+ $this->Haml = new CakeHamlParser($this);
+ foreach ($this as $prop => $value) {
+ $this->Haml->{$prop} = $value;
+ }
+
$this->Haml->assign_by_ref('__haml', $this->Haml);
if ($this->layout && $this->autoLayout) {
$layout = $this->renderLayout($content_for_layout);

0 comments on commit 14802f0

Please sign in to comment.
Something went wrong with that request. Please try again.