lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Mar 1, 2015 at 8:38 AM, Joh Journeyer J.
<oosaprogrammer@gmail.com> wrote:
> This is some part of it.
>
> Let me show you part I don't understand.
>
>   $if{$items|1}[==[
>   ................
>   ]==],[==[Nothing to do!]==]
>

This is part of the Cosmo template language, and is a conditional
block. If the first element of the items array in the template
environment is not nil or false then the block will expand to the
first block inside [==[ ]==], otherwise it will expand to the block
after the comma.

> And the part below also.
>
>   $items[[
>   <li item_id="$id"><input class="item" type="checkbox"
> $if{$done}[=[checked]=] item_id="$id"/> $title
>     <a href = "#" class = "remove" item_id = "$id">Remove</a></li>
>   ]]
>
>
> There are parts galore which I don't understand..
> But If you give me some hint I believe I can understand about orbit..

This is also Cosmo: there must be an array of tables in the template
environment called items, and Cosmo will repeatedly expand the block
for each table in this array in a template environment where each key
is bound to the corresponding value. These are all explained in the
the documentation for Cosmo: http://mascarenhas.github.io/cosmo/

> Thank you very much in advance!
>
> Journeyer
>
>

--
Fabio Mascarenhas