php - OpenCart: Create custom controller class -
i have custom script meant generate images customer.
i need script part of controller, because need script able use:
if (!$this->customer->islogged()) { $this->session->data['redirect'] = $this->url->link('account/download', '', true); $this->response->redirect($this->url->link('account/login', '', true)); }
in order check if customer logged in. otherwise, can access link when logged out, dangerous shop.
in custom script, have included:
<?php require_once('system/engine/controller.php'); class controllertestabc extends controller{ public function index() { echo 'hello world'; exit; } } ?>
i'm echoing hello world see if page run. however, page blank.
note: attempting access script using href like:
$viewimg ="<a target='_blank' href='view_code.php?id=".$id."&showdate=".$showdate." 'class='cat_links'>".$showname."<font size='-1'></a>";
why page blank? i've included path controller engine, function index() doesn't run.
why page blank?
you're getting 500 error. check log file.
if don't know php logging add: phpinfo();exit;
@ top of script temporarily , show error log in use.
alternatively, try temporarily turning on logging screen with: ini_set('display_errors',1);error_reporting e_all;
Comments
Post a Comment