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.

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();

Login

Who's Online

394 user(s) are online (321 user(s) are browsing Support Forums)


Members: 0


Guests: 394


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits