1
zer0fill
Using smarty in module's admin menu?
  • 2003/12/23 2:53

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


is it possible to use smarty in a module's admin menu? I understand that the stock modules are hard-coded html in the php files, but for new devs, can we incorproate smarty or must we hard-code as well?

2
zer0fill
Re: Using smarty in module's admin menu?
  • 2004/1/1 2:46

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


^bump

3
kevinv
Re: Using smarty in module's admin menu?
  • 2004/1/1 2:54

  • kevinv

  • Friend of XOOPS

  • Posts: 44

  • Since: 2003/1/4 1


It's your module, I imagine it's ok to do whatever you want

I don't know of a reason not to use them. Can anyone else provide a reason not too?

4
zer0fill
Re: Using smarty in module's admin menu?
  • 2004/1/1 3:02

  • zer0fill

  • Not too shy to talk

  • Posts: 137

  • Since: 2003/12/2


i meant, is there an easy way to do it like in the module (user side)? i've looked though a lot of other modules and their admin side files all mix php with html than just using smarty.

my point was when/if the admin-side will be using smarty by default. afaik, i have to start including every smarty piece than letting the XOOPS core do it for me.

ex:
...
    default: 
// show list
        
$xoopsTpl =& new XoopsTpl();
        
$xoopsOption['template_main'] = 'site_admin/index.tpl';
        
$xoopsTpl->display(XOOPS_ROOT_PATH.'/modules/mymod/templates/site_admin/index.tpl');
...

gives me an error
Fatal errorCall to undefined function: () in d:domainssomedomain.orgpublic_htmlclasssmartySmarty.class.php on line 1658


[edit]
Wow. that was easier than i thought; didn't know i can still call the 'db:' argument in the $xoopsTpl->display. for anyone else that's interested, this is all you need in the admin file

include(XOOPS_ROOT_PATH.'/class/template.php');
$xoopsTpl = &new XoopsTpl();                        
$xoopsTpl->display('db:site_admin/formwiz_admin_index.tpl');

Login

Who's Online

227 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 227


more...

Donat-O-Meter

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

Latest GitHub Commits