The problem is you are passing a URL as the first argument to
response.render, but it takes the path to a view (it assumes a root path
under the application's /views folder, so you only need to give the path
from that point).
Anthony
On Friday, March 18, 2016 at 2:21:31 PM UTC-4, Jacob Thoenne
Thanks, :)
On Sep 16, 6:04 pm, mdipierro wrote:
> from gluon.template import render
> def index():
> return render()
>
> look at the source code of that function it has lots of options.
>
> On Sep 16, 11:47 am, JC11 wrote:
>
> > Is it possible to call response.render(view, vars) in a con
from gluon.template import render
def index():
return render()
look at the source code of that function it has lots of options.
On Sep 16, 11:47 am, JC11 wrote:
> Is it possible to call response.render(view, vars) in a controller,
> but have the view not a file, but as a string ?
>
> Th
Gotcha! I have to put the response.render file in app/views/ and not
in app/views/default/
Thanks for clarifying.
--D
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe
I just tried and work well
In views/test.html
{{=myvar}}
In views/default/test2.html
{{=outstr}}
In controllers/default.py
def test2(): # note test2.html does not exist
outstr = response.render('test.html',dict(myvar='MyVarTest'))
return dict(outstr=outstr)
No layout. Just '
After more experiments, I have encountered some unexpected
behaviour. This is what I did:
Create: test.html
{{=myvar}}
def test():
response.render('test.html',dict(myvar='MyVarTest'))
return dict()
Result ... default/test2: MyVarTest (OK and expected)
def test():
outstr = res
I believe response.render is the answer after all.
I think I had been using a non-existent view!
Thanks, D
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this gr
Please show us the actual code for the action and the view.
Massimo
On Jan 30, 8:48 am, villas wrote:
> How does one retrieve a html view without including the layout?
>
> e.g. In my controller:
> outstr = response.render('item.html',dict(myvar=myvar))
> My view item.html is:
> This is my
8 matches
Mail list logo