|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Elements after template block keep returning
hi,
I want to dynamically create rows in a table for questions and answers. After that you can submit them. Problem is my submit button also keeps returning after each question (with it's answers) index.php: PHP Code:
So the program goes to showEnquete.php showEnquete.php: PHP Code:
And my showEnquete.tpl file: Code:
<div id="wrapper">
<h1>Enquete » {NAAM}</h1>
<div id="content">
<form id="enqueteForm" action="#">
<table>
<!-- BEGIN row -->
<tr>
<td>{VRAAG}</td>
</tr>
<tr>
<td><input type="radio" id="antwoord1" name="antwoord" value="1">{ANTWOORD1}</td>
</tr>
<tr>
<td><input type="radio" id="antwoord2" name="antwoord" value="2">{ANTWOORD2}</td>
</tr>
<tr>
<td><input type="radio" id="antwoord3" name="antwoord" value="3">{ANTWOORD3}</td>
</tr>
<tr>
<td><input type="radio" id="antwoord4" name="antwoord" value="4">{ANTWOORD4}</td>
</tr>
<tr>
<td><input type="radio" id="antwoord5" name="antwoord" value="5">{ANTWOORD5}</td>
</tr>
<!-- END row -->
</table>
<input type="submit" value="Antwoorden verzenden" />
</form>
</div>
</div>
Any ideas of what I'm doing wrong? Last edited by eLIX : July 24th, 2007 at 12:47 PM. |
|
#2
|
|||
|
|||
|
At first,
require_once('html/IT.php'); is wrong. It should be: require_once 'HTML/Template/IT.php'; Now to your question: You call parseCurrentBlock() without having selected a block. Therefore, the internal current block property still has the '__global__' value, which causes the whole template to be parsed for each question. => Calling setCurrentBlock() before the loop should solve the problem. |
|
#3
|
|||
|
|||
|
Quote:
Yea thnx I found it allready myself |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > Elements after template block keep returning |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|