In your controller:
a = [1,2,3]
return locals()
In your view:
{{for i in a:}}
{{=i}}
{{pass}}
On Tue, May 12, 2015 at 11:46 PM, KevC <[email protected]> wrote:
> Hi!
>
> I got a problem, I wanna print a list or string on a 'view' using a 'for'
> but the view only show me the last number or letter. For example:
>
> My controller...
>
> for i in 'hola':
> print i
> return locals()
>
>
> My view...
>
> {{=i}}
>
> The view only show me the letter 'a'.
> Other example:
>
> a = [1,2,3]
> for i in a:
> print i
> return locals()
>
> My view...
>
> {{=i}}
>
> The view only show me the number 3.
>
> I got a mistake? Somebody help me.
> I used the console and It's ok, print all list and string.
>
> My best regards.
>
>
>
>
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
Massimiliano
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.