1
crazysnake
smarty pb / ad a var and text area
  • 2004/6/30 16:21

  • crazysnake

  • Just popping in

  • Posts: 2

  • Since: 2004/6/30


hi everyone !
well, i know well php but smarty language is hard for me...
i want to do a very simple thing, create a variable putting inside a random number... like the "£varname=rand(1,7);" for example in php

really thank you in advance

p.s: oh and i forgot, i really tried during hours to modify the textarea shape (like reducing numbers of cols) but without success, is it really possible ?

2
Dave_L
Re: smarty pb / ad a var and text area
  • 2004/6/30 17:38

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


You could do this in a template:

Here is a random value between 1 and 7: <{'1'|rand:'7'}>


The syntax is obscure, though. A more straightforward method is to assign the varible in a .php file, and then reference it in a template.

In .php file:

$xoopsTpl->assign('random_value'rand(1,7));


In template:

Here is a random value between 1 and 7: <{$random_value}>



3
crazysnake
Re: smarty pb / ad a var and text area
  • 2004/6/30 19:41

  • crazysnake

  • Just popping in

  • Posts: 2

  • Since: 2004/6/30


it's exactly that
and it works
smarty was getting me crazy ^^
thankx a lot!!

Login

Who's Online

485 user(s) are online (135 user(s) are browsing Support Forums)


Members: 0


Guests: 485


more...

Donat-O-Meter

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

Latest GitHub Commits