Skip to content

Instantly share code, notes, and snippets.

@iftee
Last active July 4, 2021 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iftee/d408648336ba3ce7ce3f to your computer and use it in GitHub Desktop.
Save iftee/d408648336ba3ce7ce3f to your computer and use it in GitHub Desktop.
PrestaShop Custom Page without CMS - CustomPageController Class
<?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');
// }
}
@Sk250290
Copy link

thanks for this code. it has help me a lot .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment