Demo: parse_file, keep GLOBAL markups

Welcome to Demo: parse_file, keep GLOBAL markups

[=SOME_GLOBAL_MARKUP=]

[=SOME_OTHER_MARKUP=]


The End
Assign:

SOME_GLOBAL_MARKUP

SOME_OTHER_MARKUP




												

include_once( 'includes/pTemplate.php' );

// PHP to process things of Index page here
$page_title = 'Demo: parse_file, keep GLOBAL markups';
$page_content = 'Welcome to Demo: parse_file, keep GLOBAL markups';

$pTemplate->assign_var('PAGE_TITLE', $page_title);
$pTemplate->assign_var('PAGE_CONTENT', $page_content);

$some_global_var = '[=SOME_GLOBAL_MARKUP=]';
$some_other_var = '[=SOME_OTHER_MARKUP=]';

$pTemplate->assign_vars(array(
	'SOME_GLOBAL_MARKUP' => $some_global_var,
	'SOME_OTHER_MARKUP' => $some_other_var
	));

$pTemplate->add_file( 'templates/pparse_file_keep_vars.html' );
$output = $pTemplate->pparse_file( 'templates/pparse_file_keep_vars.html', false, false );

Other demos

View Online Documentation