Demo: pparse, delete GLOBAL markups

Welcome to Demo: pparse, delete GLOBAL markups





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: Delete forgotten GLOBAL markups before output';
$page_content = 'Welcome to Demo: Delete forgotten GLOBAL markups before output';

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

$pTemplate->add_file( 'templates/pparse_global_vars.html' );
// parse file, keep GLOBAL markups
$output = $pTemplate->pparse_file( 'templates/pparse_global_vars.html', false );

// after very very very very long code
// we forgot to remove GLOBAL markups
// just call pparse, no worry about where they're
$pTemplate->pparse( $output );
echo $output;

Other demos

View Online Documentation