Announcement

Collapse
No announcement yet.

Local variables in templates?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Local variables in templates?

    Hi folks,

    I'm working on a project that requires doing a lot of math in Store Morph templates, using mvt:assign statements. I'm getting tired of typing l.settings: at the beginning of every variable name; it's tedious and makes the code hard to read. So I'm looking for a shortcut.

    These templates are not Merchant UI pages. I have a custom module that manages its own templates, and runs them by calling Template_Render() in the compiled template file. What will happen if I start writing variables as l.xxxxx instead of l.settings:xxxxx? Are there any other local variables in that scope that I might clobber?

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    The only reason you would need to use l.settings: would be if you need the variable available to output to the page. using l. should work just fine for your needs.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment

    Working...
    X