1
Brad
Smarty Variable Within String?
  • 2004/6/30 2:29

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


Can a Smarty variable be used within a string as shown below?

<link rel="stylesheet" href="themes/<{$theme}>/style.css" />

Or should $theme be the entire string, i.e.:

$theme = "themes/" . $theme. "/style.css"

<link rel="stylesheet" href=<{$theme}> />


Thanks for your help!

Brad

2
Brad
Re: Smarty Variable Within String?
  • 2004/6/30 13:00

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


In other words... Are Smarty variables macro-expanded (example 1 above) or are they like standard variables (example 2 above)?

3
Mithrandir
Re: Smarty Variable Within String?

Your first line should work nicely.

It is used quite extensively with
href="<{$xoops_url}>/modules/[...]
without problems

4
Brad
Re: Smarty Variable Within String?
  • 2004/6/30 13:14

  • Brad

  • Not too shy to talk

  • Posts: 150

  • Since: 2003/12/4


I'm pretty sure I figured out the answer in my stumblings around the Smarty web site.

I believe that I can use Smarty variables as shown in example 1. They are macro-expanded.

[edit]Thanks Mith, for verifying it for me. I see you got your post in while I was crafting this one up.[/edit]

Login

Who's Online

252 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 252


more...

Donat-O-Meter

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

Latest GitHub Commits