1
phillipd
Some explanation on syntax.
  • 2004/7/13 20:20

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


Could I impose on someone to please explain templates. I.E. the one for the FormHowTo at:

(http://wiki.xoops.org/wakka.php?wakka=FormHowTo)

I understand it is iterating through some elements.

1) Are these the objects added to the form it is iterating through?

2) What does the javascript line do? What uses Javascript here?

3) Is
4) Is the "foreach" line a smarty thing, PHP, Or java script?

Where are some good examples and explanations for this stuff?

Thankyou very much for your explanations. I really appreciate it. Steep learning curve for this cool stuff. (Template follows)

----------------------------------------------------------
<{$testform.javascript}>
>



<{foreach item=element from=$testform.elements}>




<{/foreach}>
<{$testform.title}>
<{$element.caption}> <{$element.body}>



2
Mithrandir
Re: Some explanation on syntax.

1) Elements from the form are assigned to Smarty by using $testform->assign($xoopsTpl); instead of $testform->display(); in which case the form and its elements (the HTML code and attributes) are assigned to a Smarty array.

2) If Javascript is added to the form, this will be inserted at that specified point

3) <{$variablename}> is a Smarty tag, which takes the assigned "name" attribute from the form and puts it in place of the <{$testform.name}>

4) <{foreach}> is a Smarty tag

Check out http://smarty.php.net for more information on Smarty and how to use it - just remember that XOOPS uses <{ and }> as tags, where Smarty default uses { and }

Login

Who's Online

801 user(s) are online (67 user(s) are browsing Support Forums)


Members: 0


Guests: 801


more...

Donat-O-Meter

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

Latest GitHub Commits