mirror of
				https://github.com/Mibew/handlebars.php.git
				synced 2025-11-04 12:05:09 +03:00 
			
		
		
		
	Update UnlessHelper.php
To comply with handlebars.js, If adds an extra layer when need to access parents (https://github.com/wycats/handlebars.js/issues/196)
This commit is contained in:
		
							parent
							
								
									c6f3e0fd5e
								
							
						
					
					
						commit
						abb88322e0
					
				@ -52,6 +52,8 @@ class UnlessHelper implements Helper
 | 
			
		||||
    {
 | 
			
		||||
        $tmp = $context->get($args);
 | 
			
		||||
 | 
			
		||||
        $context->push($context->last());
 | 
			
		||||
 | 
			
		||||
        if (!$tmp) {
 | 
			
		||||
            $template->setStopToken('else');
 | 
			
		||||
            $buffer = $template->render($context);
 | 
			
		||||
@ -63,6 +65,8 @@ class UnlessHelper implements Helper
 | 
			
		||||
            $buffer = $template->render($context);
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        $context->pop();
 | 
			
		||||
 | 
			
		||||
        return $buffer;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user