Hi Sebastian,

1) The methods in controller are only for your URLs. For example the
view() method in your controller makes this url accessible: /app/
controller/view. Please read more on MVC here:
http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller#Description

2) Yes, you can call it in the view as method(args) but as I have
mentioned in the first answer, this method will not be defined in the
controller but will be defined in the model. For example you have a
post model. Define a function: def say_something(something): return
something. You are able to use it in the view as the following:

{{= say_something("hi from a method that is defined in the model") }}

Good luck.

On Oct 31, 10:26 pm, Sebastian Brandt <[email protected]> wrote:
> Hi everyone,
>
> I have 2 questions:
>
> 1. Is there a special place where I should place self defined
> functions (controller maybe?)
>
> 2. If I add a function in my controller with def foobar: can I call it
> in the view by blabla(argument_here)?
>
> Thanks in advance,
> Regards,
>
> Sebastian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to