E
E
entermix2015-02-27 19:58:36
Kohana
entermix, 2015-02-27 19:58:36

Why is the variable (array) not accepted?

I'm trying to pass an array to a Kohana template..
This is how it works:

$errors = array('111',);

$content = View::factory('index/info/v_info_index')->bind('errors', $errors);

And if you do it like this:
$content = View::factory('index/info/v_info_index')->bind('errors', array('111'));

an error occurs:
ErrorException [ Fatal Error ]: Cannot pass parameter 2 by reference

Why is that? I'm betraying the same array

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2015-02-27
@entermix

Because only variables can be passed by reference.
https://php.net/manual/en/language.references.pass.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question