Glad to help.  I should also mention that functions defined in a
controller that take arguments or start with a double underscore are
not exposed by URL.

On Oct 31, 2:45 pm, Sebastian Brandt <[email protected]> wrote:
> Thank you very much mengu and mr.freeze,
>
> you enlightend me a bit again about web2py, I try to learn a bit every
> single day :-)
> I am not a a learned coder and trying to learn python and web2py a bit
> but my experience is small till now (especially when it comes to
> theoretical concepts).
> Thanks again!
> Sebastian
>
> On 31 Okt., 20:35, mengu <[email protected]> wrote:
>
> > 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#De...
>
> > 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