SMT code inside Miva Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BPS
    Mini Mivite

    • Aug 2009
    • 49

    #1

    SMT code inside Miva Script

    Hi,

    i am working on small miva program and i need to to execute code like <mvt:foreach iterator="item" array="basket:items"> </mvt:foreach> inside miva script is there any way i can execute SMT tags inside miva script so that it will execute value on screen.
  • RayYates
    Developer Partner



    • Dec 2006
    • 1517

    #2
    Miva Script functions can output values directly to the screen based on the attribute STANDARDOUTPUTLEVEL

    Also you want to use the MvFOREACH tag. It behave like he SMT version but with more options. see the example below.

    Miva Script is a server side web scripting language is especially well suited for development of web applications having built in support for SQL and xBase3 databases.

    Miva Script is a server side web scripting language is especially well suited for development of web applications having built in support for SQL and xBase3 databases.


    Code:
    <MvFUNCTION NAME="MyFunction" PARAMETERS="basket_items var" STANDARDOUTPUTLEVEL="[B]html,text,compresswhitespace[/B]">
    
        <MvFOREACH ITERATOR = "l.item" ARRAY = "l.basket_item" INDEX = "l.pos">
    
            <MvEVAL EXPR="{ l.item::code }"> <MvEVAL EXPR="{ l.item:name }"><br>
    
        </MvFOREACH>
    
        <MvFUNCTIONRETURN VALUE="{ miva_arrray_max(l.basket_item) }">
    </MvFUNCTION>
    Also you can use the SMT tag mvt:do to call the compiled function from inside a page template. This is a great way to add functionality to you page templates without writing entire modules.

    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton

    Comment

    Working...
    X