I'm trying to run component calling example from Myghty
http://www.myghty.org/examples/components/index.myt with Pylons.
# controllers/test.py
...
def index(self):
m.subexec('/index.myt')
templates/index.myt and components/component.myt are from Myghty
examples.
Accessing http://127.0.0.1:5000/test/ shows form but selecting
different component calling options doesn't make any difference.
index.myt doesn't see call_type from form variable. I suspect,
controller has to call a template in a different way to let it see post
variables. Am I missing something that explained in Pylons
documentation?
<%args>
call_type = None
</%args>
<%python scope="init">
</%python>
<h3>/examples/components/index.myt</h3>
<form method="POST" action="index">
Select the type of component call you would like.
Press "submit" to enact the call upon the template
"component.myt".
<br/><br/>
<input type="radio" name="call_type" value="" <% not call_type
and 'checked' or '' %>>None<br/>
<input type="radio" name="call_type" value="plain" <% call_type
== 'plain' and 'checked' or '' %>>Plain<br/>
<input type="radio" name="call_type" value="subrequest" <%
call_type == 'subrequest' and 'checked' or '' %>>Subrequest<br/>
<input type="radio" name="call_type" value="soft" <% call_type
== 'soft' and 'checked' or '' %>>Soft Redirect<br/>
<input type="radio" name="call_type" value="hard" <% call_type
== 'hard' and 'checked' or '' %>>Hard Redirect<br/>
<input type="submit">
</form>
<div style="border:1px solid;margin:20px;padding:10px;">
<%python>
if call_type=='plain':
m.comp('component.myt')
elif call_type=='subrequest':
m.subexec('component.myt')
elif call_type=='soft':
m.send_redirect('component.myt', hard=False)
elif call_type=='hard':
m.send_redirect('component.myt', hard=True)
else:
m.write("didnt call component")
</%python>
</div>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss
-~----------~----~----~----~------~----~------~--~---