mirror of
				https://github.com/Mibew/handlebars.php.git
				synced 2025-10-31 10:21:05 +03:00 
			
		
		
		
	Update IfHelper.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
						415a3b00b8
					
				| @ -57,15 +57,23 @@ class IfHelper implements Helper | ||||
|         } | ||||
| 
 | ||||
|         if ($tmp) { | ||||
|             $context->push($context->last()); | ||||
|              | ||||
|             $template->setStopToken('else'); | ||||
|             $buffer = $template->render($context); | ||||
|             $template->setStopToken(false); | ||||
|             $template->discard($context); | ||||
|              | ||||
|             $context->pop(); | ||||
|         } else { | ||||
|             $context->push($context->last()); | ||||
|              | ||||
|             $template->setStopToken('else'); | ||||
|             $template->discard($context); | ||||
|             $template->setStopToken(false); | ||||
|             $buffer = $template->render($context); | ||||
|              | ||||
|             $context->pop(); | ||||
|         } | ||||
| 
 | ||||
|         return $buffer; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user