|
The emit and sqlquery TagsThe <emit> tag is a plugin-based data management system. Generally speaking, <emit> will iterate through all the data in a dataset such as the result of a SQL query, processing the contents of the tag for each item in the dataset. The source of the dataset is specified in the tag's arguments, along with a few source-dependent parameters. See the chapter on emit in the creator manual for more details. The emit tag allows to take full advantage of the Roxen variable scopes. Applying this to the case of SQL queries, the dataset is a tabular result, and the items are the result's rows. The source to be used is named "sql", and it takes as additional arguments host (the SQL-URL of the host to be contacted) and query (the SQL query to be executed). Additionally, it accepts the same parameters as the sqloutput tag. The example in the tablify chapter can be rendered with emit as:
Remember: _ is the default scope. Should it be unavailable, or should you want to use it for some other tag, you can use another scope, like this:
The sqlquery tag can be rendered with an empty emit tag
can thus be translated into
There is no builtin way to emulate the sqltable tag, you'll have to follow the syntax described for the <tablify> tag previously. |
|||||||||||