Announcement

Collapse
No announcement yet.

Understanding the Miva Exit command

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

    Understanding the Miva Exit command

    Say I have a template called PROD-INFO and in this template I render another template using code like this...
    Code:
    <mvt:comment>Current Template: PROD-INFO</mvt:comment>
    <mvt:do name="l.result" file="g.Module_Feature_TUI_MGR" value="TemplateManager_Render_Page('PROD-LOOKUP')" />

    In the PROD-LOOKUP template I run some code but if I hit an error I output an error message then exit like this
    Code:
    <mvt:comment>Current Template: PROD-LOOKUP</mvt:comment>
    <mvt:if expr="g.jsonData:isError EQ 1">
        <mvt:do name="l.result" file="g.Module_Feature_TUI_MGR" value="TemplateManager_Render_Page('PROD-NOT-FOUND')" />
        <mvt:exit />
    </mvt:if>
    In my testing it looks like <mvt:exit /> will not only exit PROD-LOOKUP but also exit the original template PROD-INFO.

    Am I understanding how this works correctly? I want to double check before I rely on this behavior.

    #2
    I was mistaken yesterday. The <mvt:exit /> does not exit out of all templates. Once <mvt:exit /> is hit in the PROD-LOOKUP template the rest of the PROD-INFO template is then processed.

    Comment

    Working...
    X