keweli Posted August 30, 2011 Share Posted August 30, 2011 When i was using 1.3x, I would just create a .php page like the other pages with the: include(dirname(__FILE__).'/header.php'); $smarty->display(_PS_THEME_DIR_.'newpage.tpl'); etc... I see now controllers are used now: require(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('SitemapController')->run(); What is the best way to create my own .PHP pages? Link to comment Share on other sites More sharing options...
TommyKaneko Posted September 14, 2011 Share Posted September 14, 2011 The below method is a bit hackish, but it seems to work. Put the following code in to a custom .php file on your root folder. <?php include(dirname(__FILE__).'/config/config.inc.php'); // create a new class and make the canonicalRedirection method blank ControllerFactory::includeController('IndexController'); class CustomController extends IndexController { public function canonicalRedirection () { } } $controller = new CustomController(); $controller->init(); $controller->displayHeader(); /* * custom code here */ // add content using templates $smarty->display(_PS_THEME_DIR_.'custom-page.tpl'); $controller->displayFooter(); ?> 1 Link to comment Share on other sites More sharing options...
Recommended Posts