Last active
July 4, 2021 17:34
-
-
Save iftee/d408648336ba3ce7ce3f to your computer and use it in GitHub Desktop.
PrestaShop Custom Page without CMS - CustomPageController Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Create a custom page in PrestaShop without CMS - CustomPageController class | |
* Read the detailed tutorial at https://www.linkedin.com/pulse/prestashop-how-create-custom-page-without-cms-iftakhar-hasan/ | |
*/ | |
/* The classname here will be the name of the controller */ | |
class CustomPageController extends FrontController{ | |
public function init(){ | |
parent::init(); | |
} | |
public function initContent(){ | |
parent::initContent(); | |
$this->setTemplate(_PS_THEME_DIR_.'custom-page.tpl'); | |
} | |
/* The following code portion is optional. | |
* Remove the double-slashes to activate the portion | |
* if you want to use external stylesheet and JavaScript for the page. | |
* Create the CSS and JS files in the css and js directories of the theme accordingly | |
*/ | |
// public function setMedia(){ | |
// parent::setMedia(); | |
// $this->addCSS(_THEME_CSS_DIR_.'custom-page.css'); | |
// $this->addJS(_THEME_JS_DIR_.'custom-page.js'); | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for this code. it has help me a lot .