Pass two arrays to a view in Kohana

2

I need to pass two arrays to a view, is it 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 to my view, does anyone know how I can do this?

    
asked by anonymous 06.03.2014 / 21:12

1 answer

0

So:

$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 .

    
06.03.2014 / 23:04