Pass two arrays to a view in Kohana

Asked

Viewed 59 times

2

I need to pass two arrays to a view, it is possible to do this?

Arrays are created as follows:

$cliente = ORM::factory('cliente')->where('id', '=', $id)->find();
$usuario = ORM::factory('usuario')->where('codCliente', '=', $cliente->id)->find_all();

I need to pass the array $cliente and the array $usuario for my view, does anyone know how I can do this?

1 answer

0


Thus:

$this->template->cliente = $cliente;
$this->template->usuario = $usuario;

Or so:

$this->template->content = View::factory('sua/view/aqui')
    ->bind('cliente', $cliente)
    ->bind('usuario', $usuario); 

In this case (using bind()) you are referencing the variables in $this->template->content.

Browser other questions tagged

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