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 echo
to the return string of the geraFormTipo1()
method and printed it to HTML
.
When I accessed the html after printing, I noticed that inside textarea
was populated as: <?php $respostaA ?>
. The intention was that in the future I would populate the bank data for html
, ie the variable that was to be return (from bank to html) is being printed in textarea
, which is wrong.
What should I do to fix my code?
For example: I had printable inside the index.php
$formulario = $new Questionario($objQuestoes);
$formHTML = $formulario->geraFormTipo1();
echo formHTML;
<textarea name="respostaA"><?php $respostaA ?></textarea>
- Would go bank popular for html in the future.
- the text field of my textarea is printing
<?php $respostaA ?>