1
The information that I take from the user model (getTimeLine method) reaches the homeController, but does not reach the homeView in the input type Hidden in the value attribute.
public function perfil($id) {
$dados = array();
$p = new posts();
if(isset($_POST['msg']) && !empty($_POST['msg'])) {
$msg = addslashes($_POST['msg']);
$time_line = addslashes($_POST['time_line']);
$p->inserirPost($msg, $time_line);
}
$u = new usuarios($id);
$dados['nome'] = $u->getNome();
$dados['localizacao'] = $u->getLocalizacao();
$dados['avatar'] = $u->getAvatar();
$dados['feed'] = $u->getFeed();
$dados['time_line'] = $p->getTimeLine();
$this->loadTemplate('home', $dados);
}
<!-- Formulario -->
<div class="well">
<h4 class="text-center">Redactar un nuevo Tweet</h4>
<form method="POST" class="form-group">
<textarea name="msg" class="form-control" rows="3"></textarea><br/>
<input type="hidden" name="time_line" value="<?php echo $time_line; ?>">
<input type="submit" value="Twittear" class="btn btn-primary" />
</form>
</div>
<!-- End formulario -->
Put the code here and the images, it is simpler than asking someone to enter another location to verify your error
– Victor
The first image is output from that variable ?
– Alisson Acioli
The first image is a var_dump of the $data array that is in the controller, in this array has everything I need to show in the view. The second image shows the view source code, where everything in $data is printed, minus the time_line variable in the Hidden input.
– Tiago de Oliveira