nvelocity DataTable data using the Foreach

Original: the Foreach NVelocity data in a DataTable

 tripDetailList DataTable is a type of data, Logo, TripTypeName, TipTypePrice dt for the column name and the like.

The new version of nvelocity1.1 support directly use the column name to get the value of the way, but does not support indexing, such as row [0] / row [ "colname"].

The following are examples of code s:

      #foreach($tripDetail in $tripDetailList.Rows)

                    <li> 

                        <span>
                            <a>$!{tripDetail.TripTypeName}</a>
                            <p>$!{tripDetail.TripTypeDesc}</p> 
                        </span>
                    </li>
                 #end

Added: similar to example:! $ {TripDetail.TripTypeName} This attribute is read-only, # set method can not change its value

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/11058081.html