Smarty in_array Wert

Habe ich array wie folgt

{
     "sCode":"05",
     "sCodeName":"critical_tight_connection",
     "iSeverity":1,
     "aData":{
         "iLevelOfDetailt":2,
         "iDuration":35,
         "sLabel":"Labai trumpas pers\u0117dimas, 35 min.",
         "sLink":""
     }
}

ich Schreibe ihn mit smarty (array werden nicht serialisiert, ich hab es getan hat für Ihre conveniece)

{if !empty( $aSegment.aNotices.aStop )}
    <ul>
        {foreach from=$aSegment.aNotices.aStop item=aNotice}
            <li>
                <img class="{$aNotice.sCodeName}" />
                {$aNotice.sLabel}
            </li>
        {/foreach}
    </ul>
{/if}

prüfen wie man mit smarty, wenn '05' existieren in aNotices.aStop.sCode ? (vor der foreach-Zyklus)

Versucht, diese

{if in_array('05', $aSegment.aNotices.aStop)}
    exist
{/if}
Vielleicht {php} und {/php} um die if-Anweisung hilft.
Nein, das ist nicht richtig.

InformationsquelleAutor MyMomSaysIamSpecial | 2013-01-18

Schreibe einen Kommentar