22
The smarty works on the normal modules site of my programed module. But I wanna now add some admin functions. And for this I like to use also the smarty template. But it does not work. I found the following tread about the same question but not with an answer:
https://xoops.org/modules/newbb/viewtopic.php?topic_id=21907&forum=8I have in the normal module that works:
----------------------------------
require('../../mainfile.php');
$xoopsOption['template_main'] = 'emailform.html';
require(XOOPS_ROOT_PATH.'/header.php');
$xoopsTpl->assign('itemSourceEmail', $refSourceEmail);
require(XOOPS_ROOT_PATH.'/footer.php');
In the Admin that does NOT work:
----------------------------
require('../../../mainfile.php');
include '../../../include/cp_header.php';
include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$xoopsOption['template_main'] = 'emailform.html';
xoops_cp_header();
$xoopsTpl->assign('itemSourceEmail', $refSourceEmail);
xoops_cp_footer();
=> The error is: Call to a member function on a non-object in
line 270.
The line 270 is the $xoopsTpl->assign
Did I forgot an include?
Any input or remark where I can get more information will help
many thx
Markus