Hello Michel,

I send you example that works with PHPLib template. This is a method I
use in my scripts.

Hope it helps you.

ML> Ruslan Ohitin wrote:

>> Hello Michel,
>>
>> You mixing php variables and Template variables. They are from
>> different "namespaces". set_var() takes associative array with string
>> keys - Template var names. Edit one line of your code:
>>
>> ML>     $var = ${"DAY".$j};
>> $var = "DAY" . $j; // $var is a string "DAYn"
>>
>> --
>> Best regards,
>>  Ruslan Ohitin
>>  mailto:[EMAIL PROTECTED]
>>

ML> I am afraid that this suggestion didn't help me.
ML> or am i missing something?

ML> With the example above i get the (string) value of variable $var to be "DAYn" -
ML> And not the variable name, which is what i want.
But this is what Template::set_var() wants! PHP knows nothing about
template variables. Assigning value to $DAY1 will not lead to change
template var {DAY1} to this value.

ML> In theory what i want to achieve is this:
ML> $DAY1="Monday";
ML> $DAY2="Next day";
ML> $DAY4="Some other day";
ML> ....
ML> ....

ML> I have 54 Template variables named "DAYn".
ML> I want to (in a for loop - 'cause there are 54 of them!) transfer all string
ML> values from my $day[n] array to the Template variables namned "DAYn".
ML> The array $day[n] is then supposed to hold the required strings.
ML> $day[1]="Monday";
ML> $day[2]="Next day";
ML> $day[3]="Some other day";
ML> ...
ML> ...


ML> --

ML> Michel Laine



-- 
Best regards,
 Ruslan
 mailto:[EMAIL PROTECTED]
-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to