0
public function geraFormTipo1(){
return
<<<EOT
<div class="questao-{$this->objQuestoes->numQuestao()}" {$this->isHide}>
{$this->label()}
<table class="table tabela-modelo-1">
{$this->estruturaMain()}
</table>
Justifique sua resposta
<textarea name="resposta{$this->objQuestoes->numQuestao()}"><?php echo \$resposta{$this->objQuestoes->numQuestao()} ?></textarea>
</div>
EOT;
}
I gave one echo in the return string of the method geraFormTipo1() and printed on HTML.
When I finished the html after printing, I realized that inside the textarea became populated as: <?php $respostaA ?>. The intention was that in the future I would popular the database data for the html, or is the variable that was to be returned (from the database to html) is being printed in the textarea, what is wrong.
what I must do to fix my code?
for example: I had it printed inside the index.php
$formulario = $new Questionario($objQuestoes);
$formHTML = $formulario->geraFormTipo1();
echo formHTML;
<textarea name="respostaA"><?php $respostaA ?></textarea>
- would popular from the bank to html in the future.
- the text field of my textarea is printing
<?php $respostaA ?>
your file has php extension? Are you using any framework? Which is your server,
Apacheorphp -S?– Brumazzi DB
I am not using framework and the extension is in php. I am using apache.
– carlos
Using xampp in Windows or manual installation (LAMP)?
– Duque
I am using xampp in windows. I tried to host on the site, and gave the same thing, the tags are being printed in the textarea
– carlos