1
srmcatee
xoopsTpl - Using in Admin Screen
  • 2006/12/1 2:02

  • srmcatee

  • Just popping in

  • Posts: 63

  • Since: 2005/8/22


I have a module I'm converting to 2.0.16. I'm unable to use $xoopsTpl->assing()

What is the correct sequence of include files I should have in an admin page to enable $xoopsTpl?

My current page is:

$xoopsOption['template_main'] = 'oscmembership_optionlist.html';
//include("../../../mainfile.php");

include '../../../include/cp_header.php';
include '../../../class/xoopsformloader.php';
include '../../../class/pagenav.php';

include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php';

xoops_cp_header();

I get this error:
Call to a member function on a non-object in /var/www/xoops2016/modules/oscmembership/admin/osclistselect_smarty.php on line 58
Steve
ChurchLedger.com - A Xoops Module Developer

2
leostotch
Re: xoopsTpl - Using in Admin Screen
  • 2006/12/1 6:07

  • leostotch

  • Just popping in

  • Posts: 76

  • Since: 2006/4/1 1


The template engine is not instanciated by default in an admin page, you have to do it yourself.

le="color: #000000"><?php include_once '../../../mainfile.php'; include_once XOOPS_ROOT_PATH . '/include/cp_header.php'; ... ... ... xoops_cp_header(); include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; include_once XOOPS_ROOT_PATH . '/class/template.php'; $xoopsTpl = new XoopsTpl(); $xoopsTpl->assign(); ..... ..... $xoopsTpl->display( 'db:oscmembership_optionlist.html' ); xoops_cp_footer();