Location: PHPKode > scripts > Dynamic Page > dynamic-page/exception_example1_index.php
<?php

require_once("dynamic_page.class.php");

try {

	/**
	 * Exception #1
	 * Constructor method calls without parameter
	 */
	$myPage = new DynamicPage();

	echo "Before apply DynamicPage, comment tag <--user --> is hidden:</br>";

	$myPage->showPage();

	echo "After apply DynamicPage, comment tag <--user --> was replaced to new content:</br>";

	$myPage->replaceInPage("user", "Marcos", true); // input 'true' in the 3rd parameter to republishing the tag
	$myPage->replaceInPage("user", " Bezerra");     // or omit that for not.
	$myPage->showPage();

} catch(DynamicPageException $dpe) {

	echo $dpe;

}

unset($myPage);

?>
Return current item: Dynamic Page