How do I set the "searched" value in input with RainTPL

0

I'm changing my project to RainTPL and found nothing in their documentation about it.

Before I used it as follows:

<form method="POST" class="row py-4" action="">

<?php
$nome = (!empty($_POST['nome'])) ? $_POST['nome'] : '';
$telefone = (!empty($_POST['telefone'])) ? $_POST['telefone'] : '';
?>

<input type="text" class="col-3 form-control" name="nome" placeholder="Nome" value="<?php echo htmlentities($nome); ?>">
<input type="text" class="col-3 form-control" name="telefone" placeholder="Telefone" value="<?php echo htmlentities($telefone); ?>">

How would you use this with RainTPL?

    
asked by anonymous 05.09.2018 / 16:59

1 answer

0

You need to enter a variable for RainTPL to use on the form. For example: variable "user".

The HTML code looks like this:

<input type="text" class="col-3 form-control" name="nome" placeholder="Nome" value="{$user.nome}">
<input type="text" class="col-3 form-control" name="telefone" placeholder="Telefone" value="{$user.telefone}">
    
11.09.2018 / 20:28