popular within mysql textarea for form

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 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 ?>
asked by anonymous 12.04.2016 / 20:12

1 answer

0

Try this way, maybe I typed something wrong, I did not try, but I got it to understand the idea.

return "
    objQuestoes-> numQuestao ()} '{$ this-> isHide} >
            {$ this-> label ()}             Home             {$ this- > structureMain ()}
                          Justify your answer             objQuestoes-> numQuestao ()} '> Response
{$ this-> objQueses-> numQuestao ()}                      ";

    
12.04.2016 / 21:10