1
I'm trying to get started with using SMARTY templates, and I am having trouble understanding how they work. I'm using the news module as a model, so all the questions below refer to news_index.html and news\index.php.
1. What is $xoopsOption, and what does this line do:
$xoopsOption['template_main'] = 'news_index.html';
I think what it does is tell the php file what SMARTY template to use (although on the smarty site the template files are .tpl, not .html). Is that right?
2. Why is it that $xoopsOption is used for things like:
$xoopsOption['storytopic']
$xoopsOption['storynum']
. . . but $xoopsTpl->assign(...) is used for everything else?
In other words, if 'storytopic' and 'storynum' aren't needed for the template, why not just save them as scalar variables $storytopic and $storynum? Why do you want them as part of the $xoopsOption object? Perhaps knowing the answer to #1 above will help me understand this.
3. At the bottom of the index.php file, there are a bunch of what look like config assignments:
$xoopsTpl->assign('lang_go', _GO);
$xoopsTpl->assign('lang_on', _ON);
$xoopsTpl->assign('lang_printerpage', _NW_PRINTERFRIENDLY);
$xoopsTpl->assign('lang_sendstory', _NW_SENDSTORY);
$xoopsTpl->assign('lang_postedby', _POSTEDBY);
$xoopsTpl->assign('lang_reads', _READS);
Are these required all the time? I can't find where they are used, or how they are used. They don't show up in the template file at all.
Thanks in advance for any help.