You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							40 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							40 lines
						
					
					
						
							1.1 KiB
						
					
					
				
								<!-- BEGIN: main -->
							 | 
						|
								<html>
							 | 
						|
								<head><title>example 1</title></head>
							 | 
						|
								<body>
							 | 
						|
								this is a simple replace test. the text in bold should contain "TEST": <b>{VARIABLE}</b><br>
							 | 
						|
								now a dynamic block test:<br>
							 | 
						|
									<!-- BEGIN: block1 -->
							 | 
						|
									this is block 1.<br>
							 | 
						|
									<!-- END: block1 -->
							 | 
						|
									<!-- BEGIN: block2 -->
							 | 
						|
									this is block 2.<br>
							 | 
						|
									<!-- END: block2 -->
							 | 
						|
									<!-- BEGIN: block3 -->
							 | 
						|
									<p><table border=1>
							 | 
						|
										<tr>
							 | 
						|
											<td>id</td>
							 | 
						|
											<td>{DATA.ID}</td>
							 | 
						|
										</tr>
							 | 
						|
										<tr>
							 | 
						|
											<td>name</td>
							 | 
						|
											<td>{DATA.NAME}</td>
							 | 
						|
										</tr>
							 | 
						|
										<tr>
							 | 
						|
											<td>age</td>
							 | 
						|
											<td>{DATA.AGE}</td>
							 | 
						|
										</tr>
							 | 
						|
									</table></p>
							 | 
						|
									<!-- END: block3 -->
							 | 
						|
								<br><br>
							 | 
						|
								global variables can be parsed directly into the html without assigns:<br>
							 | 
						|
								$HTTP_HOST={PHP.HTTP_HOST}<br>
							 | 
						|
								$PHP_SELF={PHP.PHP_SELF}<br>
							 | 
						|
								$HTTP_USER_AGENT={PHP.HTTP_USER_AGENT}<br>
							 | 
						|
								etc..<br>
							 | 
						|
								(<font color=red>note</font> that these variables are scanned in the constructor when creating the XTemplate object!
							 | 
						|
								so if you need some variables which you have set after creating the template object, you need to call <b>$xtpl->scan_globals()</b>
							 | 
						|
								before parsing the actual block!
							 | 
						|
								</body>
							 | 
						|
								</html>
							 | 
						|
								<!-- END: main -->
							 |