How do I set "searched" value in input with Raintpl

Asked

Viewed 86 times

0

I’m moving my project to Raintpl and found nothing in their documentation about it.

Before I used to wear it like this:

<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 it with Raintpl?

1 answer

0


You need to enter a variable for Raintpl to use it in the form. For example: "user variable".

The HTML code would look 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}">

Browser other questions tagged

You are not signed in. Login or sign up in order to post.